is it possible to create a TreeListView with ComboBoxes on the nodes so I could change the description of the node by selecting a value from the dropdown list? We use Silverlight 4 and VS 2010.
Thank you in advance
3 Answers, 1 is accepted
You may try to use the GridViewComboBoxColumn. Another possibility would be to define a CellTemplate for the particular column and set a RadComboBox inside.
Maya
the Telerik team
Hi,
I've tried to create a TreeListView with ComobBoxes in the nodes using the
approach with GridViewComboBoxColumn. But I wasn't able to bind my
observablecollection to the ComboBox. Would it be possible to provide a small
example how to bind a ComboBox within the Tree of the TreeListView.
For the start I need simply one node in a GridListView with a ComboBox in it.
Here is what I have tried so far
<telerik:RadTreeListView x:Name="TreeListView"
AutoGenerateColumns="False"
ItemsSource="{Binding List}"
SelectedItem="{Binding Current, Mode=TwoWay}"
CanUserReorderColumns="True"
CanUserFreezeColumns="True"
EnableColumnVirtualization="True" EnableRowVirtualization="True">
<telerik:RadTreeListView.Columns>
<telerik:GridViewComboBoxColumn ItemsSourceBinding="{Binding List}" Header="Description"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Amount}" IsReadOnly="True" Header="Amount" />
</telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>
Many thanks in advance
Firstly, the data sources of the RadTreeListView and the GridViewComboBoxColumn need to be separate ones. Furthermore, you have to define at least the DataMemberBinding, DisplayMemberPath, ItemsSource and SelectedValueMemberPath properties of the column.
You may take a look at our online documentation for further reference. Furthermore, you may download the sample project from this forum thread that illustrates how to define the GridViewComboBoxColumn. Both target RadGridView, but the settings of the column are the same.
Maya
the Telerik team