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

Trouble binding combobox from cellEditTemplate

2 Answers 30 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rayne
Top achievements
Rank 1
Rayne asked on 08 Jun 2011, 10:35 PM
I have gridView defined inside a DataTemplate for a TabControl.

Within this GridView I have a column that I need to provide a list of choices from over 200 records with multiple columns, that needs to be filterable, so I thought either a button that brings up a popup window, or using a combobox with a gridview. Either solution requires me to bind to properties on my viewmodel for the list of 200+ records.

Controls inside the DataTemplate defined for the TabControl are bound to the VM by setting a name on the UserControl and binding to {DataContext.Property, ElementName=MyUserControl}. This works, until I get to the DataTemplate that is defining the CellEditTemplate. I thought I could use the same method for declaring my binding, but it just isn't working.

Is there a heirarchy limit I'm reaching, but having a DataTemplate defined inside of a DataTemplate?

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 09 Jun 2011, 06:28 AM
Hi,

 ElementName binding will not work since the namescope is different. You can use RelativeSource instead. 

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
Rayne
Top achievements
Rank 1
answered on 09 Jun 2011, 01:30 PM
Thank you. That worked.
Tags
GridView
Asked by
Rayne
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Rayne
Top achievements
Rank 1
Share this question
or