Custom Filter Editors

6 posts, 1 answers
  1. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 02 Aug 2010 Link to this post

    Hello,

    I'd like to provide my DataFilter with custom editors depending on the property type and the operator, I've tried to set the EditorTemplateSelector property, and it works great for defining custom editors depending on property type. But I'd like to be able to set the editor depending on the operator. For example, in a String type propety I wish that when the "Is equal to" and the "Is not equal to" operators are selected user may choose an item in a Combobox with al the valid values, but when "Contains", or "Starts with",... operators are selectors user may type some characters in a textbox.

    I'd also like the possiblitlty to choose the operators available in the filter depending on the property. In my business objects, I have several properties which "Is greater", "Is less" and so on filters has no sense in business terms.


  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 02 Aug 2010 Link to this post

    Hi Daní,

    I will log both of your feature requests in out PITS system. RadDataFilter is still a young control and it will be constantly improved based on our customers' requests.

    Issue ID 2921 - Define a custom filter editor based on the chosen filter operator.

    Issue ID 2922 - Define available filter operators based on the ItemPropertyInfo.

    Please, vote for them in order to move them up the priority list.

    Kind regards,
    Ross
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 03 Aug 2010 Link to this post

    Hi Ross,

    I voted for both. Meanwhile, I can live without the second feature, but not without the first. Is there any workaround to get this feature? I need to release a new version soon and I'd like to provide the DataFilter feature in this version. In fact, currently, the application provides a DataFilter I developped. When I saw this new Telerik control I decided to migrate to yours one as I consider is more powerful and better, and the mos important, I will no have to mantain it!!! I want to make thos change soon, to avoid users get used with the old one and be against the change (my DataFilter is worst, but is more intuitive).
  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 04 Aug 2010 Link to this post

    Hi Daní,

    Currently there is no workaround. I will do my best to implement these features for the Latest Internal Build that will be released on the 13th of August.

    Here is how I plan to do these two things. I will need your opinion before I start writing the actual code.

    Issue ID 2921 - Define a custom filter editor based on the chosen filter operator.

    Currently, when the Property combo-box changes its value, the template selector asks you to provide an editor based on the ItemPropertyInfo provided as item parameter of the SelectTemplate method. I will have to create a new class that will hold both the ItemPropertyInfo and the FilterOperator. When the filter-operator combo-box changes it's value, I will request and editor through the template selector as well. In other words -- each time one of the two combo-boxes (Property and Operator) change their value, I will ask for an editor and I will provide both the ItemPropertyInfo and the FilterOperator in some kind of new info class that will aggregate them both. I guess that you will need them both at once in order to decide what editor to return.

    How does this sound? Is it reasonable?

    Issue ID 2922 - Define available filter operators based on the ItemPropertyInfo.

    Here I intend to create a new event called FilterOperatorsLoading. In the event arguments I will provide the Type of the property and a list with the default operators for this particular Type. If you do not do anything in the event handler -- the default operators will just show up like the do now. But since they will be in a List you will have the option to remove some of them based on the Type. On the other hand -- if you try to add a new operator to the list I will throw an exception since this is an Invalid Operation.

    How does this sound?

    In case you have any ideas about these things, please share them with me, since I would like to gather opinions before I start actually coding.

    I am looking forward to hearing from you.

    Sincerely yours,
    Ross
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  6. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 04 Aug 2010 Link to this post

    Thank you so much Ross, I really appreciate your interest, thanks again,

    About the first feature, that's requesting for a editor whenever Property o Operator changes, your idea is exactly what I expected.

    About the second feature, I'd like to being able to provide the available Operators via  ItemProperties property, for example, that will be nice in some MVVM scenarios like mine, but I supose it may be difficult to change ItemPropertyInfo class and this will not be a good solution when a Source is provided. You proposed soultion is good enough for me.
  7. Answer
    Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 10 Aug 2010 Link to this post

    Hi Daní,

    Unfortunately the ItemPropertyInfo in WPF is a system class and we cannot change it. Since we share a common codebase, we have created an ItemPropertyInfo class for Silverlight, which we can change, but we will not do it since it will be different from WPF.

    Sincerely yours,
    Ross
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner