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

Can't access columns by x:name...

2 Answers 47 Views
GridView
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 29 Jul 2010, 10:18 AM
Hi,

More an observation than anything else, but I was wondering why you can't access GridViewDataColumns by their name? I can call them x:name="MyGridViewDataColumn", but when I try to access this in the 'code behind' it is always null. it's easy enough to access via GridView.Columns[index], but it seems strange having the ability to give the columns names, but not to be able to use them.

James.

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 29 Jul 2010, 10:23 AM
Hello James,

 Grid columns are plain DependencyObjects - you can reference only UI elements this way.

Kind regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Luis Takada
Top achievements
Rank 1
answered on 14 Oct 2011, 07:09 PM
I have the same problem when changing my control from WPF to Silverlight. My question is why does it work in WPF and not in Silverlight?
Tags
GridView
Asked by
James
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Luis Takada
Top achievements
Rank 1
Share this question
or