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

[Solved] Filter when button is pressed

1 Answer 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 23 Jun 2009, 09:22 PM
I've read the some posts about this. I've looked at 2 demos, the web mail one and the one under docs titled Search on key press/button click. In both of these examples a seperate search box was used.

What I want to do seems fairly straight forward and revolved around the way the filtering is implemented. Most search screens from google to most apps out there have a number of search fields to fill out, then you click a search button. Using the AutoPostBackOnFilter, then clicking enter works great, except for the autopostback. Users want to be able to fill out several fields, then hit search to find what they are looking for.

What I need to do is use the existing autogenerated filter fields, or templated fields. Then on the click of a search button filter on those fields. Additionally, I want to disable the functionality that will filter when you select a filter type.

Can anyone point me in the right direction? Is there a single javascript funciton exposed, like doFilter() that I can call when the user clicks a button?

Thank you!

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 26 Jun 2009, 12:09 PM
Hi James,

There are two possible options in this case.
The first is to set the filter expression for the control directly, for example when the user presses the button. When you go to the server, you can set the filter expression, by accessing the RadGrid1.MasterTableView.FilterExpression.
Alternatively, you can use client side script, to trigger a succession of filter commands.
I hope this information helps.

Greetings,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
James
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or