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

[Solved] paging - jump to next column value

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 26 Aug 2013, 07:21 PM
I was wondering if it was possible to implement the following using a RadGrid:

Let's say my grid is populated with data that is already sorted by an "Event Name" column, then by an "Event Time" column. There are typically a few hundred total records divided by 10 records per page. I would like to be able to "jump to" the next change in value for a particular column. Ideally, there would be left/right arrow buttons on the bottom paging bar that would set the current page index to that of where the next/previous chunk of "Event Name" entries starts/ends.

Does anybody know if something like this is achievable?

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 29 Aug 2013, 01:30 PM
Hi Matt,

The scenario seems possible by enabling the grid grouping. As you can see from the online demo once the data is grouped it is sorted alphabetically. This means that if each group has exactly ten records when the next button is clicked only the page index should be incremented by one. If each group however consists of different number of items you should implement custom logic for paging. For this you can follow these steps:
  1. Once the next button is clicked set the page size of RadGrid to int.MaxValue and rebind it.
  2. Find the first item in the next group and calculate on which page it resides with the old page size.
  3. Return the page size to it's initial value, set the CurrentPageIndex to the calculated value from step 2 and rebind RadGrid.

Note that if a large data set is bound to the grid this scenario may cause a performance issue as calling a rebind is a slow procedure.

Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or