0 Replies - 7331 Views - Last Post: 24 July 2013 - 08:56 AM Rate Topic: -----

#1 solarissf   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 27-March 12

wpf databound datagrid - how to prevent duplications

Posted 24 July 2013 - 08:56 AM

Using WPF, I have a datagrid, databound to a observable collection/collectionviewsource.

Say my grid has only 1 column ("NAME").
How can I make sure I only populate the grid with NO duplications.

I've looked at multivalue converters... validationRules.

Either way, I don't know how to display values with no duplications.

Any assistance would be GREATLY appreciated.

                            <DataGridTextColumn Header="Market">
                                    <MultiBinding Converter="{StaticResource ResourceKey=myConverter}">
                                        <Binding Path="tMarketName" UpdateSourceTrigger="PropertyChanged">
                                                <local:UniqueNameValidation CurrentCollection="{StaticResource ResourceKey=ViewSource}"/>
                                        <Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type DataGrid}, AncestorLevel=1}"/>
                                        <Binding Path="."/>
                                        <Binding Source="{StaticResource ResourceKey=MyData}"/>

Is This A Good Question/Topic? 0
  • +

Page 1 of 1