Is it possible to change the default behavior of Filter option

6 posts, 0 answers
  1. gans
    gans avatar
    48 posts
    Member since:
    Jan 2012

    Posted 20 May 2012 Link to this post

    We have a requirement where we need the Filter Option Dialog/ filter functionality to behave differently from the default behavior. 

    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?

  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 21 May 2012 Link to this post

    Hi,

     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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. gans
    gans avatar
    48 posts
    Member since:
    Jan 2012

    Posted 21 May 2012 Link to this post

    Vlad,

    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?

  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 21 May 2012 Link to this post

    Hello,

     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. 

    Regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. gans
    gans avatar
    48 posts
    Member since:
    Jan 2012

    Posted 23 May 2012 Link to this post

    I am trying to come up with Custom Filter Control as you suggested. But its going to look almost exactly like the default control you have provided. 

    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?

  7. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 24 May 2012 Link to this post

    Hello,

    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 >>

Back to Top
UI for WPF is Visual Studio 2017 Ready