This is a migrated thread and some comments may be shown as answers.

MyFilterDescriptorBindingBehavior

10 Answers 69 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Joel Palmer
Top achievements
Rank 2
Joel Palmer asked on 12 Jan 2016, 06:40 PM

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

10 Answers, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 15 Jan 2016, 12:45 PM
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
0
Joel Palmer
Top achievements
Rank 2
answered on 21 Jan 2016, 08:41 PM

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

0
Stefan Nenchev
Telerik team
answered on 26 Jan 2016, 08:25 AM
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
0
Joel Palmer
Top achievements
Rank 2
answered on 26 Jan 2016, 04:24 PM
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.
0
Stefan Nenchev
Telerik team
answered on 29 Jan 2016, 11:30 AM
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
0
Joel Palmer
Top achievements
Rank 2
answered on 29 Jan 2016, 04:02 PM

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

 I'll give it a try,

Joel

0
gordon
Top achievements
Rank 1
answered on 27 Feb 2018, 07:12 PM

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.

 

0
Stefan
Telerik team
answered on 02 Mar 2018, 12:33 PM
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.
0
gordon
Top achievements
Rank 1
answered on 02 Mar 2018, 04:03 PM

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.

0
Stefan
Telerik team
answered on 06 Mar 2018, 02:58 PM
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.
Tags
DataFilter
Asked by
Joel Palmer
Top achievements
Rank 2
Answers by
Stefan Nenchev
Telerik team
Joel Palmer
Top achievements
Rank 2
gordon
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or