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

2 posts, 0 answers
  1. Anu
    Anu avatar
    8 posts
    Member since:
    May 2011

    Posted 03 Apr 2012 Link to this post

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

  2. Stefan
    Stefan avatar
    2908 posts

    Posted 06 Apr 2012 Link to this post

    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:

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

    Kind regards,
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top