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

Custom filtertemplate for GridTemplateColumn

1 Answer 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 1
Phil asked on 13 Apr 2011, 09:28 PM
I have a GridTemplateColumn that displays 3 columns of data - Parent/Child relationship with the current row.  I need to be able to filter on any of the three columns.

I can create a FilterTemplate that displays 3 textboxes in the FilterCell to match up with the 3 columns of data.  But I can't get the GridFilterMenu to attach to the textboxes.  The example for  the MS DropDownlist customization is sort of what I'm trying to do (http://www.telerik.com/help/aspnet-ajax/grdoperationswithdropdownlistinedititemtemplate.html).  But that is based on a single column of data.

Any ideas of how I can expand this to incorporate all the textboxes in the filter template?

Thanks

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 19 Apr 2011, 11:27 AM
Hello Phil,

Basically, to be able to filter a template/custom column you have to set its DataField property. Since this value accepts a single field, filtering by more than one field from the same template column is not supported scenario.

As a workaround you can add separate columns for the different fields, but hide those of them that you do not need. This way you can apply the approach demonstrated in this online example and add additional controls in the filter template of the template column. I have attached a small sample that implements this technique. For demonstration purposes I have left the "City" column visible, but if you do not need it in the grid columns, just hide it by setting Display="false".

I hope this helps.

Regards,
Martin
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
Phil
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or