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

Obtaining a reference to the GridColumn from the FilterTemplate

1 Answer 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
dmw
Top achievements
Rank 1
dmw asked on 17 Nov 2010, 11:38 AM
Hi,

I have developed a custom control which is placed inside the <FilterTemplate> of a GridBoundColumn. I am hoping to be able to get a reference to that GridBoundColumn from the control, in order to read certain properties (UniqueName, DataField, and CurrentFilterValue), but looking through the Parent hierarchy, I wasn't able to spot it.

Can you recommend a way of getting the column object reference?

Thanks,

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 22 Nov 2010, 10:11 AM
Hi dmw,

You need to know the UniqueName of the column. Then, inside your user control you can do:

GridFilteringItem filterItem = this.NamingContainer as GridFilteringItem;
GridColumn column = filterItem.OwnerTableView.GetColumnSafe("ColumnUniqueName");
//column is now a reference to the grid column containing your control
//in the FilterTemplate


Veli
the Telerik team
Browse the vast support resources we have to jumpstart 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
dmw
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or