There are cases in which you may want to fetch only a fixed number of records and perform operations over this specified set of data. Telerik RadGrid allows such data manipulation through the custom paging mechanism integrated in the control. The main steps you need to undertake are:
- Set AllowPaging = true and AllowCustomPaging = true for your grid instance;
- Implement code logic which to extract merely a fixed number of records from the grid source and present them in the grid structure.
 |
Note that having custom paging enabled will disable the default grid paging. |
This online example demonstrates an approach to implementing custom paging with Telerik RadGrid . The simulated "DataLayer" wraps the logic of extracting records for only the specified page and deleting records. Telerik RadGrid maintains the pager buttons, changing of pager and other presentation specific features.
Note: There is no universal mechanism for grouping when custom paging is allowed. The reason for this is that with the custom paging mechanism you fetch only part of the whole information from the grid datasource. Thus, when you trigger the grouping event the grid is restricted from operating with the whole available source data and is not able to group the items accurately. Furthermore, the aggregate functions as Count, Sum, etc. (covering operations with the whole set of grid items) will return incorrect results.
A workaround solution for you could be to use hierarchy in the grid instead of grouping to single out the grid items logically and visually according to custom criteria. Thus you will be able to use custom paging without further limitations.
Another approach is to build your own complex SQL statements which to get the whole available data from the grid datasource and then group the items in the grid with custom code logic.
Finally, you can use standard paging instead of custom paging to ensure the consistency of the data on grouping.
Another available option for custom paging support is represented in the how-to section.