FilterDescriptor on two members

5 posts, 0 answers
  1. developer
    developer avatar
    10 posts
    Member since:
    Jul 2014

    Posted 16 Jul 2014 Link to this post

    Hi

    I need to give to the user the possibility to build filter not only between a Member and a value (like Column1 = 10) but also between two members (like Column1 >= Column2).

    How could I do?

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 17 Jul 2014 Link to this post

    Hello,

    This FilterDescriptors collection can contain CompositeFilterDescriptor or FilterDescriptor instances. The CompositeFilterDescriptor contains other descriptors and combines them with a logical operator of OR or AND. The simple FilterDescriptor class is a leaf of the tree and contains a Member, Operator, Value, MemberType.
    I am afraid there is not a way to compare between two members.

    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. developer
    developer avatar
    10 posts
    Member since:
    Jul 2014

    Posted 17 Jul 2014 Link to this post

    I'm developing a workaround to implement this feature.

    Basically, I created my own EditorTemplate where the user can choose to insert a static value or select an item from a Combobox which is populated with che Member of my object.

    The only problem that I found is that I have to cast each member from my datasource to a string member. Because if I create a filter on a Integer member the value can't be a string (in my situation the value would be the member name, which is a string). But this solution isn't perfect because if all the Member are string I can't use every comparision operator, but only the ones that work with the string type. What can you suggest to me? Are there any way to avoid this limitation?









































































  5. developer
    developer avatar
    10 posts
    Member since:
    Jul 2014

    Posted 17 Jul 2014 in reply to developer Link to this post

    Sorry for the white spaces, it has been a mistake
  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 18 Jul 2014 Link to this post

    Hello,

    Basically you can check the Create Custom Filter Editors article. If this is not what you need, may I ask you to open a new support ticket and send me a demo project illustrating your attempt?

    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top
UI for WPF is Visual Studio 2017 Ready