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

[Solved] How do I get column for a user control

1 Answer 89 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jerry Kurata
Top achievements
Rank 1
Jerry Kurata asked on 29 Nov 2010, 05:54 PM
Hi,

I have a gridview with several columns that can contain a user control.  These columns are created dynamically and I need to know which column contains the user control.  How can I determine from within the user control the column?  I tried using code of the form:
GridViewColumn gc = this.ParentofType<GridViewColumn>();, but this always returns null.

Thanks,

jerry

1 Answer, 1 is accepted

Sort by
0
Accepted
Yavor Georgiev
Telerik team
answered on 29 Nov 2010, 06:06 PM
Hi Jerry Kurata,

 You need to find the parent GridViewCell (using ParentOfType<>) and then query its Column property to find out which column you are in.

All the best,
Yavor Georgiev
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
Jerry Kurata
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Share this question
or