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

defailt for filter field column

2 Answers 47 Views
GridView
This is a migrated thread and some comments may be shown as answers.
andi
Top achievements
Rank 1
andi asked on 31 Mar 2008, 04:02 PM
is it possible to set the filter options in a radgridview to default "contains" instead of "equals" by code?

thanks, andreas

2 Answers, 1 is accepted

Sort by
0
Pedro Valero Matas
Top achievements
Rank 1
answered on 31 Mar 2008, 04:27 PM
An example:

Dim Filtro As Telerik.WinControls.UI.GridKnownFunction
Filtro = Telerik.WinControls.UI.GridKnownFunction.Contains

For Each column As Telerik.WinControls.UI.GridViewDataColumn In RadGridView.MasterGridViewTemplate.Columns

column.Filter.Function = Filtro

Next column

This option is only valid for columns containing a string value
0
Nikolay
Telerik team
answered on 03 Apr 2008, 08:41 AM
Hi Pedro Valero Matas,

Thank you for contacting us.

Indeed, Andi, you should set the filter function to Contains for the Columns collection of RadGridView.

Please refer to the code snippet below:

foreach (GridViewDataColumn col in radGridView1.MasterGridViewTemplate.Columns)  
{  
    col.Filter.Function = GridKnownFunction.Contains;  

The above code will only apply to columns with string values, since Contains functionality is only applicable to such columns.

I hope this helps. If you have additional questions, do not hesitate to contact me.

Greetings,
Nikolay
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
andi
Top achievements
Rank 1
Answers by
Pedro Valero Matas
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or