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

Filters dont persist on page change?

4 Answers 160 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 26 Jan 2012, 11:30 AM
So i drop down the filter boxes and initiate a filter for Starts With B. I get 25 Results (set to 10 per page).   If I go to page 2 then back to page 1 the filter is no longer applied. 

What is the recommended way to have filter settings persist across page changes?

Thanks,
Michael

4 Answers, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 26 Jan 2012, 03:28 PM
I get the same problem, but if I filter and then click to the next page, the filter has disappeared.
0
Shinu
Top achievements
Rank 2
answered on 27 Jan 2012, 05:38 AM
Hello Michael,

Take a look at the following demo.
Grid / Persisting Grid Settings

-Shinu.
0
Michael
Top achievements
Rank 1
answered on 27 Jan 2012, 12:50 PM
So, the RadGrid controls don't actually persist the settings at all? Surely this should be standard functionality?  

If i'm honest, i seem to be constantly asking questions on this forum about things which should be standard functionality but are not.  This is a prime example, the grid control handles filtering and the grid control handles paging but if you wanna use both (which i would expect to be a common thing to do) then you have to go and code it yourself.

I'll look more into this class/code but it goes with out saying that I am unhappy about this solution. We have 15+ RadGrids in our product and I am now going to have to go and add this code to them all.

Michael
0
Iana Tsolova
Telerik team
answered on 29 Jan 2012, 09:48 AM
Hello,

The grid filter expression is persisted though postbacks. You can see this in the below demos for instance:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandcombo/defaultcs.aspx?product=grid

So there should something in your cases that is in fact clearing the expression implicitly. Can you elaborate a bit more on your case? How is the grid bound, where do you have calls to the Rebind() or DataBind method, is ViewState enabled? If you can share the full page code here, .aspx and .cs/.vb, we will check it out and try finding what went wrong.

Greetings,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Michael
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or