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

Filter multivalued column using radcombobox

1 Answer 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bryant
Top achievements
Rank 1
Bryant asked on 02 Jun 2011, 07:18 PM
I want to use a radcombobox to filter a radgrid column.  There is a great example of doing this and I can tweak the example to use a checkbox plus label template in the combo box.

I am running into problems when the column is not just a string field but a multivalued field.  For example I have a Person entity and that person has a property that is a list<School>.  We bind the column to the Schools property and use a repeater in the template to display the schools.  I can successfully build the combobox but am having trouble filtering for records where people only have the selected schools.

1 Answer, 1 is accepted

Sort by
0
Accepted
Veli
Telerik team
answered on 08 Jun 2011, 08:20 AM
Hello Bryant,

For this scenario you will have to use custom filtering. Because RadGrid can filter only by data in its own data source's bindable fields, you cannot use automatic filtering by values in inner lists or other non-primitive properties. Custom filtering is done by using RadGrid's ItemCommand event with either the Filter command or some other custom command fired. If you are using the Filter command, make sure you cancel it (with e.Canceled = true) to prevent default filter attempts by RadGrid. Then you can filter your data items by the specified value in  your multivalued column and rebind the grid. Let me know if further explanation is required.

Greetings,
Veli
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
Bryant
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or