0

I am using the following code for a wpf DataGrid:

How can I paginate a WPF DataGrid?

The paging works fine except that when i move to any page besides the first one and try to pick (press) any row/cell i am getting the following exception :

Specified argument was out of the range of valid values. Parameter name: position

BTW - i needed to change the declare of PagingCollectionView _cview to be not readonly.

<DataGrid ItemsSource="{Binding}" Grid.Row="1" x:Name="rightGrid" x:Uid="rightGrid" SelectionChanged="rightGrid_SelectionChanged">
...

And

private void rightGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
}
Community
  • 1
  • 1
Matan L
  • 997
  • 3
  • 14
  • 35

1 Answers1

0

The code on the referenced post was meant as an example of how to get started and has at least one bug in it (likely more than one).

As others have suggested in the comments, you might want to look at using the silverlight implementation.

Community
  • 1
  • 1
timmyl
  • 1,115
  • 9
  • 15
  • As an aside, I'll look at updating that post with the bug fix as this isn't the first person to read the answer and run into this problem. – timmyl Mar 28 '15 at 18:41