persist Datafilter

6 posts, 0 answers
  1. Kamran
    Kamran avatar
    16 posts
    Member since:
    Nov 2011

    Posted 22 Nov 2011 Link to this post

    I placed Datafilter on Popup window, which return FilterDescriptor. After that i add FilterDescriptor to Gridview. Up to now its working nice. If I again open popup, I want to set previous filter on Datafilter control, AS FilterDescriptor property of DataFilter is read only, kindly help me.

    One other thing, I am using EditorTemplateSelector for custom input filter such as Combobox. Every time when I define EditorTemplateSelector for individual Item, it become hardcoded. I want a generic solution. DataFilter that I am using can have any collection, so its very difficult for me handle this situation. Can you send me sample solution, where i can use generic EditorTemplateSelector.
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 22 Nov 2011 Link to this post

    Hello Kamran,

    The FilterDescriptors property of RadDataFilter is read-only since it is a collection property and all collection properties are read only. You add and remove elements to a collection property, you do not assign it. So you can create a FilterDescriptor and add it to the FilterDescriptors collection of RadDataFilter. Persisting a .NET such as the FilterDescriptor is beyond the scope of our support.

    As for the generic solution for your second question, I am afradi that it is not possible.

    All the best,
    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Kamran
    Kamran avatar
    16 posts
    Member since:
    Nov 2011

    Posted 23 Nov 2011 Link to this post

    Thanks for your support. I got the point, and implement this. Currently I got CompositeFilterDescriptorCollection from GridView, after that I assign this collection to RadDataFilter like
    DataFilter.FilterDescriptors.Add(FilterDescriptor[0]);

    But here is one issue, one extra and logical operator is added at the top of filter. Kindly find screen shot
  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 24 Nov 2011 Link to this post

    Hello Kamran,

    Can you please attach a sample project with this behavior. We need to debug it in order to see what you are doing. Also, please explain what is the end-goal that you are after and we will try to modify the project if it is achievable.

    Kind regards,

    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Kamran
    Kamran avatar
    16 posts
    Member since:
    Nov 2011

    Posted 24 Nov 2011 Link to this post

    Hi Team,
       Sorry I can't share source code but i can explain scenarios, I pass gridView.FilterDescriptors to popup screen

    QueueFilter(this, gridView.FilterDescriptors as FilterDescriptorCollection);

    at constructor QueueFilter I set filter to RadDAtaFilter

    public QueueFilter(UserControl parent, FilterDescriptorCollection Filters)

                {

                InitializeComponent();

                FilterDescriptor = Filters as CompositeFilterDescriptorCollection;          

                ItemPropertyDefinition property;

                property = new ItemPropertyDefinition("request_id", typeof(string), "RequestCode");

                RADDataFilter.ItemPropertyDefinitions.Add(property);

     

                if (FilterDescriptor.Count > 0 && !FilterDescriptor[0].ToString().Equals("Empty"))

                {

                    RADDataFilter.FilterDescriptors.Clear();

                   RADDataFilter.FilterDescriptors.Add(FilterDescriptor[0]);

                }

    at popup return i used following code.

    this.DailogReturnData = RADDataFilter.FilterDescriptors;

    Grid is filtered correctly, I think when i return Filter to main screen, there is some issue. 


  7. Kamran
    Kamran avatar
    16 posts
    Member since:
    Nov 2011

    Posted 28 Dec 2011 Link to this post

    Hi All,

    Use
     RADDataFilter.FilterDescriptors.AddRange(FilterDescriptorCollection );


    instead of

    RADDataFilter.FilterDescriptors.Add(FilterDescriptor);
Back to Top
UI for WPF is Visual Studio 2017 Ready