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

Binding ComboBox inside CellEditTemplate

1 Answer 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pablo Tola
Top achievements
Rank 2
Pablo Tola asked on 31 May 2010, 01:25 AM
Hello,

I have a usercontrol that has a gridview in it binded to an observablecollection defined as a property of the usercontrol.
I need a 3 level cascading comboboxes on 3 columns, and I need to bind them to either properties or methods defined inside the usercontrol code behind class.
I've tried several things but I think I'm missing something, I'm kind of new to how binding works on wpf.
I'm trying to set the binding like this:

<telerik:GridViewDataColumn  
   Header="Questions" 
   DataMemberBinding="{Binding Operation, Mode=TwoWay}">     
   <telerik:GridViewDataColumn.CellEditTemplate>     
      <DataTemplate> 
         <telerik:RadComboBox DisplayMemberPath="operation" SelectedValuePath="id" 
         ItemsSource="{Binding Operations, Mode=TwoWay}" />     
      </DataTemplate> 
   </telerik:GridViewDataColumn.CellEditTemplate> 
</telerik:GridViewDataColumn> 

Where Operations is a Property of the UserControl, but I think it's trying to find Operations as a property of the Databound Object.

Any help would be appreciated.

1 Answer, 1 is accepted

Sort by
0
Accepted
Yavor Georgiev
Telerik team
answered on 31 May 2010, 10:18 AM
Hi Pablo Tola,

 You need to explicitly reference the usercontrol element in the combobox's binding declaration like so:

{Binding Operations, ElementName=myUserControlName}

Regards,
Yavor Georgiev
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.
Tags
GridView
Asked by
Pablo Tola
Top achievements
Rank 2
Answers by
Yavor Georgiev
Telerik team
Share this question
or