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

RadGrid paging after the grid is filtered

3 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Josip
Top achievements
Rank 1
Josip asked on 03 Dec 2019, 10:13 AM

Hello,

I have a question regarding paging in RadGrid when the grid is already filtered.

I am using NeedDataSource event for binding the grid.

My datasource query is rather slow so I implemented custom paging and it is working fast as expected when paging the RadGrid when no filter is active.

But when I filter the RadGrid, the paging is very slow. Changing the page number lasts like when the grid is fetching the data when filtering.

I understand that the process of filtering cannot be faster because of my datasource query, but is there a way that I can make paging faster when my grid is filtered?

Thank You for your help.

 

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 06 Dec 2019, 08:41 AM

Hi Josip,

 

Here are some suggestions for this case:

1. Check the dedicated Custom Paging live sample and see how the filtering is handled:
https://demos.telerik.com/aspnet-ajax/grid/examples/functionality/paging/custom-paging/defaultcs.aspx

The custom paging works just with partial data that's why it is fast. Actions like Filtering, Sorting and Grouping on the other hand require the entire database that's why this cannot be modified.

2. Try Virtualization:
https://demos.telerik.com/aspnet-ajax/grid/examples/performance/virtualization/defaultcs.aspx

You can also check:
https://www.telerik.com/support/kb/aspnet-ajax/grid/details/virtualization-and-custom-paging

3. And if you have templates, you can implement the performance improvements mentioned here:
https://www.telerik.com/forums/radgrid-becomes-too-slow-when-binding-over-100-records

4. And the last solution would be to query the Database only once, then keep it in the Session, similar to this:
https://demos.telerik.com/aspnet-ajax/treelist/examples/databinding/loadondemand/defaultcs.aspx

Namely, this part:

        public DataTable TreeListSource
        {
            get
            {
                if (Session["TreeListSource"] == null)
                {
                    Session["TreeListSource"] = GetDataTable("SELECT TOP(10000) * FROM TestItems");
                }
 
                return Session["TreeListSource"] as DataTable;
            }
        }
I hope this will prove helpful.

 

Regards,
Eyup
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.
0
Josip
Top achievements
Rank 1
answered on 06 Dec 2019, 11:28 AM

Hi Eyup,

thank You for your answer.

Option 4 is the one I thought of also, but I was trying to avoid that kind of approach, keeping all data in session or viewstate or even cookie.

For now, when the grid is filterd, I am displaying all data on one page

I will report here if I find some kind of a solution.

Cheers,

0
Eyup
Telerik team
answered on 11 Dec 2019, 09:06 AM

Hi Josip,

 

Thanks for sharing your approach.

Feel free to turn to us if new questions arise.

 

Regards,
Eyup
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
Grid
Asked by
Josip
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Josip
Top achievements
Rank 1
Share this question
or