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

Manual filtering

1 Answer 69 Views
GridView
This is a migrated thread and some comments may be shown as answers.
THOMAS
Top achievements
Rank 1
THOMAS asked on 20 Dec 2011, 04:57 PM
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"};
 
}

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 20 Dec 2011, 05:02 PM
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 >>

Tags
GridView
Asked by
THOMAS
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or