MyFilterDescriptorBindingBehavior

11 posts, 0 answers
  1. Joel Palmer
    Joel Palmer avatar
    175 posts
    Member since:
    May 2009

    Posted 12 Jan 2016 Link to this post

    Your Q1 2016 example references the "MyFilterDescriptorBindingBehavior" in the "Example.xaml" file of the "DataFilter.Default Filter Editors" example.  However, that is nowhere to be found.

    I need to add a FilterDescriptor using code that is displayed in the control for the user to interact with.  This seems like the example that would cover the scenario but the documentation is incomplete.  Can you help me with this?

     Joel

  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    627 posts

    Posted 15 Jan 2016 Link to this post

    Hello Joel,

    Thank you for reporting this issue. I have checked the situation and indeed we have missed adding the implementation of this specific class. You can find it in the code for the  "Data Filter Custom Editors" demo. We will update the demo in the near future so that it has all the information needed. Please, check if this implementation suits your project needs and update me if you need any assistance. 

    Of course, if you have any further questions or concerns, do not hesitate to contact us as well.

    Regards,
    Stefan Nenchev
    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
  3. Joel Palmer
    Joel Palmer avatar
    175 posts
    Member since:
    May 2009

    Posted 21 Jan 2016 in reply to Stefan Nenchev Link to this post

    I get an Object reference error when attempting to get this working with that Behavior.  Can you compile a simple project for me?  I'd appreciate it,

     Joel

  4. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    627 posts

    Posted 26 Jan 2016 Link to this post

    Hi Joel,

    I have created a sample project based on the Default Filter Editors demo and have attached it to my reply. Please update me if it is running as expected.

    Regards,
    Stefan Nenchev
    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
  5. Joel Palmer
    Joel Palmer avatar
    175 posts
    Member since:
    May 2009

    Posted 26 Jan 2016 in reply to Stefan Nenchev Link to this post

    Awesome.  Thanks for your help. 

    So, my original objective is to be able to add FilterDescriptors during run time.  Problem is, this is a "StaticResource".  Is there a way to do this with a binding to a "DynamicResource" or better yet, as part of a property with an "IObservableCollection" approach.
  6. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    627 posts

    Posted 29 Jan 2016 Link to this post

    Hi Joel,

    You can add different FIlterDescriptors to the StaticResource during run-time by utilizing the Commands mechanism in order to not break the MVVM approach. I have updated the project I have previously provided you with so that you can add a certain FilterDescriptor during run-time and it is working as expected. Can you please review it and update me if it would suit your needs?

    If you insist on using a dynamic resource, you can achieve the effect by inheriting the DataFilter control and registering an additional DependencyProperty.

    Regards,
    Stefan Nenchev
    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
  7. Joel Palmer
    Joel Palmer avatar
    175 posts
    Member since:
    May 2009

    Posted 29 Jan 2016 in reply to Stefan Nenchev Link to this post

    Thank you very much for your attention to this.  This had me stumped. 

     I'll give it a try,

    Joel

  8. gordon
    gordon avatar
    18 posts
    Member since:
    Oct 2015

    Posted 27 Feb in reply to Stefan Nenchev Link to this post

    I'm having an issue with your sample code.  If I add or remove a filter descriptor via the RadDataFilter, MyModel.FilterDescriptors does not get updated, nor does MyFilterDescriptorBindingBehavior.CollectionChanged get called.  However, once I click on "Add Filter Descriptor" then  MyFilterDescriptorBindingBehavior.CollectionChanged gets called and MyModel.FilterDescriptors gets updated each time I add or remove a filter descriptor via the RadDataFilter.  I was hoping that  MyModel.FilterDescriptors would get updated everytime I add or remove a filter descriptor via the RadDataFilter.  Any ideas of how to do this?  Thanks.

     

  9. Stefan
    Admin
    Stefan avatar
    924 posts

    Posted 02 Mar Link to this post

    Hello Gordon,

    This behavior is indeed a bit strange. My best guess is that it is due to some timing issue. Though I cannot confirm the exact cause for it, a possible approach to overcome it would be to subscribe to the CollecitonChanged event of the FilterDescriptors collection of RadDataFilter and update the underlying collection based on it.

    Would such an approach be feasible for you?

    Regards,
    Stefan
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  10. gordon
    gordon avatar
    18 posts
    Member since:
    Oct 2015

    Posted 02 Mar in reply to Stefan Link to this post

    Hi Stefan,

    I was able to modified the behavior such that my underlying collection gets updated each time a FIlterDescriptor gets added or removed.  I use the behavior "as is" to populate the RadDataFilter FilterDescriptors from my underlying collection.  Then in dataFilter_Loaded, I unsubscribe to the datafilter collection changed event, and subscribe to the  FilterDescriptors collection changed event, and in its event handler, I modify the underlying collection to reflect changes in the RadDataFilter's FilterDescriptors.  Thanks.

  11. Stefan
    Admin
    Stefan avatar
    924 posts

    Posted 06 Mar Link to this post

    Hello Gordon,

    Thank you for the update.

    I am pleased to hear that you have managed to achieve the desired result.

    Feel free to contact us again should you need any other assistance with our components.

    Regards,
    Stefan
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top