We don't want to really FILTER the data, but to select/unselect the nodes that match the criteria.
Would it be possible to do this?
5 Answers, 1 is accepted
You can create custom filtering control similar to this demo where you can embed your own logic. The same example can be found in your local copy of our WPF examples.
Kind regards,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Thanks for the quick response. I was wondering whether it would be possible to use your default Filter Control that you guys provide and just change the Filtering logic?
Is that possible or I need to create new Custom Control and do my logic in there?
If you want to change just the distinct values you do not need to change anything - just provide your own list of values in the event.
Indeed you can use the default filtering template extracted with blend with changed logic however in this case it will be better to use your own template/control to embed custom logic.
Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I was looking at the example you had pointed out for Custom Filter. But this example doesn't show any Distinct Values like the default Filter Control. It just has two Date Controls and these dates are applied to the Filter.
I have ListBox in my Control like yours and how do I populate the ListBox with distinct values? I got the Listbox from your template as below.
I am struggling to come up with something close to what you guys have.
Do you have an example where it will list the Distinct Values of each column in the Custom Filter?
Is the Prepare() method supposed to load the Distinct Values to the ListBox?
RadGridView has a public method called GetDistinctValues (with several overloads). You can use this public method to get a list of the distinct values which you can then display in any kind of ItemsControl.
Or if you prefer, you can extract the distinct values from your data source in any other way that you find applicable, for exampel using LINQ
If you have our source code, your best shot will to explore the XAML and code-behind of our stock FilteringControl in order to understand what it does and how.
The XAML is located in FilteringControl_Style.xaml and the code behind is located in FilteringControl.cs. The view model serving the FilteringControl is inside FilteringViewModel.cs. Examine the source code if you want to learn what we are doing internally. The source code is far from trivial I am afraid.
Greetings,
Ross
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>