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

Filtering by multiple columns at once

1 Answer 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Monte
Top achievements
Rank 1
Monte asked on 03 May 2012, 04:55 PM
I have a Grid with AllowFilteringByColumn set to true. Each column in the grid has the filer textbox plus the drop down list of search options. The CurrentFilterFunction is set to 'Contains' and Autopostback is set to true. So users can enter a value and press enter which will do a 'contains' search on that column.
However there are two things that users keep trying to do that cause odd behaviour.
- They will enter a filter value in the FirstName column, then enter a value in the LastName column and press enter. Since enter is pressed while focus is on the LastName column, only that column is filtered and the FirstName filter disappears.
- The second scenario is that they will do a filter on FirstName and press enter, then after viewing the results will delete the filter on FirstName and then type a filter into LastName and press enter. When you do this the lastName filter is applied but the FirstName filter isn't checked so it reappears.
Is there a way to do multiple filters at once? I'm trying to handle the OnItemCommand event for the grid, then go through each column to see if there is a value in the textbox and then apply the filter manually there. However I'm stuck on how to generate the FilterExpression and how to check the which search option is selected (contains, startswith etc...)
Is this the correct direction or is there a better way to do this?

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 07 May 2012, 08:07 PM
Hello Monte,

You can see a sample project that shows how to manually build and maintain a custom FilterExpression in RadGrid at this address:
http://www.telerik.com/community/forums/aspnet-ajax/grid/server-side-remove-filter.aspx#2070714
I hope this helps.

Regards,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Monte
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or