I have a webdatagrid (Version=9.2.20092.1003) on the page with paging enabled. I also for the heck of it enabled dataview and view state. This data grid allows you to select multiple rows so that you can hit a command button and update a flag on each of the datarows.
If I turn off paging the code works. I get the selectedrows collection and a simple foreach loop to grab each row and push the ID to a stored procedure in LINQ to update the row. When I turn on paging, as long as I stay on Page Index 0 everything works and updates properly. When I go to any other page besides the Index = 0 I get this:
.Behaviors.Paging.PageIndex.ToString() = The Correct Page Index .Behaviors.Selection.SelectedRows.Count.ToString() = the correct number of rows I have selected
Error message: System.NullReferenceException: Object reference not set to an instance of an object.
Code in question(simplified for this post):
foreach (GridRecord igrow in wdgIgnoreList.Behaviors.Selection.SelectedRows) { value1 = igrow.Items.GetValue(1).ToString(); value2 = igrow.Items.GetValue(0).ToString(); }
I would be very grateful for any help on this. Thank you ahead of time,
DMW
For those experiencing the same issue, I upgraded from v9.2 to v10.3 and have resolved the issue. I do not know which version actually put in the fix, only that v10.3 works as expected.