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

Filter Template and combining filterExpression

1 Answer 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JustinWong
Top achievements
Rank 1
JustinWong asked on 26 Jan 2011, 08:42 PM
Hi:

I've read this example (http://www.telerik.com/help/aspnet-ajax/radgrid-filter-template.html) with great interest.  I'm not using framework 3.5 yet so I'm looking at the 2nd implementation option mentioned in this article.  In particular, the FilterCombo_SelectedIndexChanged even: 

Protected Sub FilterCombo_SelectedIndexChanged(o As Object, e As RadComboBoxSelectedIndexChangedEventArgs)
 Dim filterExpression As String
 filterExpression = "([CategoryName] = '" + e.Value + "')"
 RadGrid1.MasterTableView.FilterExpression = filterExpression
 RadGrid1.MasterTableView.Rebind()
End Sub

My question is this:  What if I have 5 columns, each wtih its own filter (some textbox, some combo, some checkbox), and they are all already set to some filter values respectively.  Looking at the above codes, it would seem that when we select a filter value from FilterCombo, the grid will rebind using ONLY the filterExpression that is associated with the FilterCombo while ignoring the filter values of all the other columns. Is that true?  If so, then it is undesirable. 

What can I do, so that within the FilterCombo_SelectedIndexChanged event, I can evaluate the existing filter values of all other filtering columns, and then combine them all into a comprehensive MasterTableView.FilterExpression ?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 01 Feb 2011, 09:50 AM
Hi Justin,

In such cases you can manually build the whole filter expression using code similar to that in the second example in this help article:

Custom option for filtering

If you have problems figuring how exactly the expressions should be concatenated, you can debug your project and follow how the filter expressions which the grid builds look.

All the best,
Tsvetina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
JustinWong
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or