I am trying to implement server side custom paging and using https://demos.telerik.com/aspnet-ajax/grid/examples/functionality/paging/custom-paging/defaultcs.aspx as a reference.
Please refer to your following code
protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
MyBusinessObjectCollection MyBusinessObjectCollection1 = new MyBusinessObjectCollection();
int startRowIndex = (ShouldApplySortFilterOrGroup()) ?
0 : RadGrid1.CurrentPageIndex * RadGrid1.PageSize;
int maximumRows = (ShouldApplySortFilterOrGroup()) ?
MyBusinessObjectCollection1.SelectCount() : RadGrid1.PageSize;
RadGrid1.AllowCustomPaging = !ShouldApplySortFilterOrGroup();
RadGrid1.DataSource = MyBusinessObjectCollection1.Select(startRowIndex, maximumRows);
}
If the user uses filtering, say in the example, searching for Unit Price 9, in this case, your ShouldApplySortFilterOrGroup() would return a true. That means maximumRows will be count of entire dataset. So, MyBusinessObjectCollection1.Select(0, 100000); would be very expensive.
I also noticed, that when filtering, items in pages in the bottom right of the grid doesnt display the correct item count.
Do you have another working example of server side paging which allows filtering?
Thank you