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

[Solved] Submit Multiple Filter Criteria

1 Answer 154 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Maxim Parsin
Top achievements
Rank 1
Maxim Parsin asked on 14 Aug 2009, 03:29 PM

I have a scenario when user wolud like to submit all grid's filter criteria at once by pressing Enter or clicking on "Apply Filter" button.
My grid has several FilterTemplates with radcomboboxes and Calendar controls

 function submitFilter() { 
                                    debugger
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>"); 
                                    var combo = $find('<%# ((GridItem)Container).FindControl("radComboBox1").ClientID %>'); 
                                    var ToPicker = $find('<%# ((GridItem)Container).FindControl("ToOrderDatePicker").ClientID %>'); 
                                    var FromPicker = $find('<%# ((GridItem)Container).FindControl("FromOrderDatePicker").ClientID %>'); 
 
                                    var fromDate = FormatSelectedDate(FromPicker); 
                                    var toDate = FormatSelectedDate(ToPicker); 
 
                                    tableView.filter('<%# _fieldName %>', fromDate + " " + toDate, "Between"); 
                                    tableView.filter("PolicyType", combo.get_selectedItem().get_text(), "EqualTo"); 

The problem here is that secont call to filter() function erase all previous filters.

Thanks in advance
Maxim

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 19 Aug 2009, 08:13 AM
Hello Maxim,

Another possible approach in this case would be to make an AjaxRequest to the server. There, you can set the filter expression directly. For example, the filter expression for a grid, filtered on a few columns will look like this:

([CustomerID] LIKE '%ALFKI%') AND ([ContactTitle] LIKE '1234%') AND ([Address] <> 'Obere Str. 57')

Here, the control is filtered on the CustomerID, ContactTitle and Address fields.
I hope this information helps.

Best wishes,
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
Maxim Parsin
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or