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

RadFilter: adding a filter with a value in the code

2 Answers 71 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Hugo
Top achievements
Rank 1
Hugo asked on 18 Feb 2016, 09:06 PM

Hello,

I have two web pages that use a RadFilter. The first one is used to set the filter for a data search. The second one is used to display the research results. The first page send the filter settings to the second one using this code line:

queryString[_QUERYSTRING_PARAM_FILTERS] = Server.UrlEncode(RadFilter1.SaveSettings());

The second web page receive the filter settings using this code lines:

RadFilter1.LoadSettings(Server.UrlDecode(Request[_QUERYSTRING_PARAM_FILTERS]));
RadFilter1.FireApplyCommand();

Here is my problem: I want to add a RadFilterEqualToFilterExpression<Boolean> filter in the code (C#) just before the results web page is opened. The value of this filter is set to true. But the value is lost during the process and the filter's value is false in the results web page.It seems that the SaveSettings() method does not save the value of a filter that has been added in the code.

Do you have any recommendation?

Thank you

2 Answers, 1 is accepted

Sort by
0
Hugo
Top achievements
Rank 1
answered on 18 Feb 2016, 09:33 PM

Here's the code where I add the filter:

RadFilterEqualToFilterExpression<Boolean> estVersionAnterieureEqualToFilterExpression = new RadFilterEqualToFilterExpression<Boolean>("EstVersionAnterieure");
estVersionAnterieureEqualToFilterExpression.Value = true;
this.RadFilter1.RootGroup.AddExpression(estVersionAnterieureEqualToFilterExpression);
RadFilter1.FireApplyCommand();

0
Daniel
Telerik team
answered on 23 Feb 2016, 02:08 PM
Hello Hugo,

Please post the string that contains the saved string. Also it would be helpful to provide some more information, for example at what point in the lifecycle did you restore the settings?

Regards,
Daniel
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Filter
Asked by
Hugo
Top achievements
Rank 1
Answers by
Hugo
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or