I'm using a winforms radvirtualgrid to display pages of data.
I allow the user to apply search strings and filters.
When data needs refreshing, I first run code to perform a total count of records on the database, then similar to pull a page of 100 records..
If I have several pages of data, zoom to the last page, then the correct number of pages is told to me in the paging panel.
If I then cause a search that retrieves less data then my code range checks the grid.pageindex against grid.totalpages and adjusts the page inded downwards.
But I've found that if Im viewing the final page of data, and a new search returns no data, then my range check fails and the pageindex is not changed in the display on the paging panel. i.e line 8 of the following code snip does nothing. I've also tried setting pageindex to zero (fails in the code), and turning paging on and off on the grid in the hope it refreshes.
I'm guessing it's something to do with there being no data. Is this a bug please, or can I do anything to reset the value to zero?
01.
Tables =
new
dsUser.MemberSelectionDataTable[TotalFilteredMembers / Grid.PageSize + 1];
02.
Grid.ColumnCount = _columnNames.Count;
03.
Grid.RowCount = totalFilteredMembers;
04.
05.
if
(Grid.PageIndex >= Grid.TotalPages)
06.
Grid.MasterViewInfo.MoveToLastPage();
07.
08.
if
(totalFilteredMembers == 0)
09.
{
10.
Grid.MasterViewInfo.MoveToFirstPage();
11.
}