RadFilter: adding a filter with a value in the code

3 posts, 0 answers
  1. Hugo
    Hugo avatar
    2 posts
    Member since:
    Feb 2016

    Posted 18 Feb Link to this post

    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. Hugo
    Hugo avatar
    2 posts
    Member since:
    Feb 2016

    Posted 18 Feb Link to this post

    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();

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 23 Feb Link to this post

    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
Back to Top