Manual filtering

2 posts, 0 answers
  1. THOMAS
    THOMAS avatar
    12 posts
    Member since:
    Jan 2011

    Posted 20 Dec 2011 Link to this post

    Hello,

    I want to set a filter in a GridView on loading. After adding the filter, the data is reduced correctly, but the filter symbol don't change and i can't remove the filter.

    Thanks!

    example code:
    public MainPage()
    {
        InitializeComponent();
        radGridView.DataLoaded += (s, e) =>
                                      {
                                          if (!radGridView.FilterDescriptors.Any())
                                          {
                                              CompositeFilterDescriptor newFilter = new CompositeFilterDescriptor();
     
                                              newFilter.FilterDescriptors.Add(
                                                  new Telerik.Windows.Data.FilterDescriptor(
                                                      radGridView.Columns[0].UniqueName
                                                      , FilterOperator.Contains
                                                      , "a"));
                                              radGridView.FilterDescriptors.Add(newFilter);
                                          }
                                      };
        radGridView.ItemsSource = new List<String> {"a", "b", "c"};
     
    }
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 20 Dec 2011 Link to this post

    Hello,

     You can use ColumnFilterDescriptor to achieve your goal. 

    All the best,
    Vlad
    the Telerik team

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

Back to Top