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

Is there a working example of custom paging that works correctly with filters?

0 Answers 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stan
Top achievements
Rank 1
Stan asked on 16 Apr 2012, 08:04 PM
On all the custom paging examples that I have seen VirtualItemCount is set to some big number and not the actual number of rows in the data source.

There are two problems with it. First, this number is misleading as grid shows "item 1 of 10000". This can be relatively easy solved by running another query against dataset, something like "select count(*) from ...", but here comes second problem.

When grid has filters the VirtualItemCount should be smaller, that is the dataset should be additionally filtered with current filter expression. On the surface, this seems not hard to do as well - change EnableLinqExpressions to 'false', grab FilterExpression propery and use the value as additional WHERE clause. The issue is that FilterExpression propery is not always set. It appears that it is not set during NeedDataSource event.

I wonder if Telerik has a complete custom paging example that works correcly with filters.

-Stan

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Stan
Top achievements
Rank 1
Share this question
or