0

I have a Xceed Datagrid whose ItemsSource is CollectionViewSource defined in XAML. Whenever grid is updated, only the row which is in focus doesn't show updated values (revert back to original values) but all of other rows are updated. If I directly bound the grid to a Collection in ViewModel then everything works fine. The problem is only when, CollectionViewSource comes into picture. Any help is appreciated.

Nerd in Training
  • 2,098
  • 1
  • 22
  • 44
Navneet Duggal
  • 91
  • 1
  • 15

2 Answers2

2

Can you try using the DataGridCollectionViewSource instead of a CollectionViewSource. By using this, you will reap the benefits of the DataGrid such as built in filtering, sorting, grouping, etc. An example from their documentation:

<Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
  <Grid.Resources>      
  <xcdg:DataGridCollectionViewSource x:Key="cvs_orders"
                                  Source="{Binding Source={x:Static Application.Current},
                                                      Path=Orders}"/>
  </Grid.Resources>
  <xcdg:DataGridControl x:Name="OrdersGrid"
                        ItemsSource="{Binding Source={StaticResource cvs_orders}}"/>
</Grid>
Nerd in Training
  • 2,098
  • 1
  • 22
  • 44
-3

I got solution... grid.CurrentItem = null

Navneet Duggal
  • 91
  • 1
  • 15