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

[Solved] CustomPaging with Filter

3 Answers 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 26 Apr 2009, 10:13 PM
Hi,

I have a table with over million records so that the query in LINQ is so slow.
Originally, my code in NeedDataSource event was

var query = (from prod in dldc.Products  

 

                    select prod);

and I set 

 

AllowPaging

 

 

="true" 

 

AllowCustomPaging

 

 

="true"

 

AllowSorting

 

 

="True"

 

AllowMultiColumnSorting

 

 

="True"

and assign the result to RagGird.DataSource. Actually here is a quick sample, the result is not only from Products, it needs to join other tables, a lot of tables.
Then I got the the performance issue, it took me over 20 mins to show the results. So I am going to use CustomPaing to make the it easy and I put the below segment in NeedDataSource event:

 

var

 

 

query = (from prod in dldc.Products

 

                    select prod);  

 

query.Skip(page * size).Take(size);

Anyway, the grid looks fine by using such paging instead of query all records from database. However, the filtering only filter the result over current page that is not what I exactly need. 
What I need is to boost the performance up with both paging and filtering. Also, how do I make RagGrid filter the products over all the products, and also with paging?

Thanks in advance.

 

 

 

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 28 Apr 2009, 03:00 PM
Hello Joe,

To attain the functionality you are searching for, you need to handle the filtering by yourself. You need to wire the ItemCommand event and there to check whether the CommandName has the same value as RadGrid.FilterCommandName.

Hence you can collect the applied filter options and when the NeedDataSource event fires apply them along with the page index. First apply the filter options and then get the required page. You can use this online help article as base to develop the required functionality.

Kind regards,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Aurore
Top achievements
Rank 1
answered on 20 Nov 2009, 02:54 PM
Hello,

Sorry but the link http://www.telerik.com/community/forums/RadGrid.FilterCommandName doesn't work.

Have you the example elsewhere ?

Thanks

Aurore
0
Georgi Krustev
Telerik team
answered on 23 Nov 2009, 09:12 AM
Hello Aurore,

Please excuse me for not providing the correct URL. Please review this online help article.

Greetings,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Joe
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Aurore
Top achievements
Rank 1
Share this question
or