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

Not keeping SQL Filter when paging.

1 Answer 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Keith Stephens
Top achievements
Rank 1
Keith Stephens asked on 07 Apr 2011, 03:43 PM
Hello All,
In my codebehind I set the sqldatasource controls filterExpression based on selecting items.

So when the page load I use the sqldatasource and bring back all records, when the user selects "sold Items" I use the sqldatasources FilterExpression to bring back just the "Sold Items" this works just fine, but when I page to the next page all my record show and not just the "Sold Items".

So each time they select an item, I add a diffent filter to the sqldatasource and then I set teh grids DataSourceID to my sqldatasource control then do a grid DataBind();

Like I said it works fine, except when I page to the next page, it's like the filter is removed and is gets everything as if there was no filter, but it should have not gotten everything in the first place because of the filter on the sqldatasource.

How can I fix this,
Thanks,
KS.

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 08 Apr 2011, 05:01 PM
Hi Keith,

You can use the GridSettingsPersister class as shown in this online example to persist the grid settings, including the filter expression, filter value and filter function for each column. To persist the filtering item data in RadGrid, you need to save and load each column's CurrentFilterFunction and CurrentFilterValue. The GridSettingsPersister does the job for you.

Best wishes,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Keith Stephens
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or