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

Custom filter row

3 Answers 150 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ninh
Top achievements
Rank 1
ninh asked on 26 Jan 2011, 10:50 AM
hi
I want to filter row default is "Contains"
So should I do?

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 26 Jan 2011, 11:07 AM
Hello ninh,

The filter operators are defined in each type of ColumnHeader. If you want to change the behavior of the filter cell for a text column, you need to find the TextColumnHeader control and the ApplicableFilterOperators property. You may either change the order they should appear or remove any of them that you think are unnecessary.  

Regards,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
ninh
Top achievements
Rank 1
answered on 26 Jan 2011, 11:14 AM
Thanks for the answer! But I do not really understand.
0
Maya
Telerik team
answered on 26 Jan 2011, 11:27 AM
Hello ninh,

The example in our demos - Custom Filter Row - contains different UserControls - NumericColumnHeader, BooleanColumnHeader, TextColumnHeader,etc. In the code behind of the TextColumnHeader has a property ApplicableFilterOperators:

protected override IEnumerable<FilterOperator> ApplicableFilterOperators
       {
           get
           {
               return new FilterOperator[]
               {
                   FilterOperator.StartsWith,
                   FilterOperator.EndsWith,
                   FilterOperator.Contains,
                   FilterOperator.DoesNotContain,
                   FilterOperator.IsContainedIn
               };
           }
       }

You may remove those that you do not want to see or change their order.
However, you may also look at this example that filters only using Contains(in case of string values) or IsEqualTo (in case of numeric values) operators.

All the best,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
ninh
Top achievements
Rank 1
Answers by
Maya
Telerik team
ninh
Top achievements
Rank 1
Share this question
or