<
telerik:GridViewComboBoxColumn
DataMemberBinding
=
"{Binding ActionID}"
Header
=
"Action"
UniqueName
=
"ActionID"
SelectedValueMemberPath
=
"ActionID"
DisplayMemberPath
=
"Name"
ItemsSourceBinding
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=telerik:RadPane},Path=viewModel.References.ActionList}"
/>
The rest of the columns are binding as expected. I was originally using ItemsSource and saw a thread that said to use ItemsSourceBinding instead. But neither one is working.
FYI: I'm also having trouble databinding several other gridviews using the same RelativeSource binding (but to different properties). I know my properties have items in them. I can see it when I debug, but the binding just isn't working for some of my controls. Other controls that are also bound using RelativeSource are working.
Is there something wrong with my comboBoxColumn or is there a limit on how many RelativeSource bindings I can use?
7 Answers, 1 is accepted
Firstly, you may take a look at our online documentation and demos on the topic of GridViewComboBoxColumn. Considering the bindings, the property set as the DataMemberBinding needs to be a part of the source of the grid, while those set for the DisplayMemberPath and SelectedValueMemberPath need to be from the source of the GridViewComboBoxColumn.
Considering the ItemsSource and the ItemsSourceBinding, the second one is used when the property keeping the data source for this column is defined in the business object. In case it is not, you can use the ItemsSource.
Maya
the Telerik team
I tried changing it to {Binding ElementName=ContentGrid, Path=DataContext.ActionList} and I'm having the same problem. This particular grid is part of a HeirarchyChildTemplate DataTemplate. Could that have something to do with why it's not finding the data it needs to bind to?
I am sending you a sample project illustrating how to bind a GridViewComboBoxColumn in the HierarchyChildTemplate to a property in the ViewModel.
Let me know if it resolves your issue.
Maya
the Telerik team
I am sending you a sample project demonstrating the settings of a GridViewComboBoxColumn when using RelativeSource. I hope it helps.
Maya
the Telerik team
I solved it by moving that particular property to a separate class that can be referenced as a StaticResource, but I wish I knew why my RelativeSource binding didn't work. I made sure all my paths were accurate.
I am glad to here that you solved the things out. Still let me know, if you need any further assistance on the topic.
Kind regards,Maya
the Telerik team