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

Set Default Column Filter in Code

1 Answer 71 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Doug Hamilton
Top achievements
Rank 1
Doug Hamilton asked on 03 Mar 2008, 10:35 PM
I'm binding a grid to a collection and adding only the columns I wish the user to see from that collection in code.  I want to set the default filter for these columns to "Starts With".  I see that there is a Filter.Function property if I bring up the the column collection through the gridview control properties but how do I get at it to set in code? 

I would have assumed that I could have said something like:

MyGridView.Columns("EmployeeName").Filter...

but Filter isn't available there.

Sorry if the answer to this is obvious but I've only just begun learning to use the Telerik controls.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Doug Hamilton
Top achievements
Rank 1
answered on 03 Mar 2008, 11:01 PM
I figured it out.  For anyone else who may have the same question, the answer was:

For Each col As GridViewDataColumn In Me.MyGridView.Columns

    col.Filter.Function = GridKnownFunction.StartsWith

Next

Tags
GridView
Asked by
Doug Hamilton
Top achievements
Rank 1
Answers by
Doug Hamilton
Top achievements
Rank 1
Share this question
or