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

How to set numeric fields filter operator default to "equal to"

1 Answer 110 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Anu
Top achievements
Rank 1
Anu asked on 03 Apr 2012, 06:54 PM
In gridview i am displaying some string fields and few numeric fields. The filter operator for string fields is automatically set to "Contains", however the numeric fields are left with "no filter". Is there a way to make the default filter for numberic fields to "equal to" without setting it on each column definition (as shown in the code below)?
GridViewTextBoxColumn colNumericField = new GridViewTextBoxColumn("NumericField");
                   colNumericField .Width = 100;
                   colNumericField .HeaderText = "Loc #";
                   colNumericField .ReadOnly = true;
                   colNumericField .FilterDescriptor = new Telerik.WinControls.Data.FilterDescriptor(null, Telerik.WinControls.Data.FilterOperator.IsEqualTo, null);
                   radGV1.MasterTemplate.Columns.Add(colNumericField );


Thanks

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 06 Apr 2012, 01:07 PM
Hi Anu,

Thank you for writing.

The FilterDescriptor object has a property called IsFilterEditor, which determines whether the Operator of this descriptor will be the default one for the column.

More information regarding FilterDescriptors can be found here: http://www.telerik.com/help/winforms/gridview-filtering-setting-filters-programmatically-simple-descriptors.html.

I hope that the provided information addresses your question. Let me know if you need further assistance.

Kind regards,
Stefan
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Anu
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or