This is a migrated thread and some comments may be shown as answers.

VirtualGrid. Page index dispaying incorrectly.

1 Answer 93 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Czeshirecat
Top achievements
Rank 2
Iron
Iron
Iron
Czeshirecat asked on 05 Oct 2018, 10:56 AM

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. }

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 Oct 2018, 12:30 PM
Hello, Claire, 

I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to update the text of the paging panel programmatically: 

this.radVirtualGrid1.VirtualGridElement.FindDescendant<VirtualGridPagingPanelElement>().PageNumberTextBox.Text = "1";

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Czeshirecat
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or