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

ComboBox in TreeListView

3 Answers 81 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
CHRISTIAN
Top achievements
Rank 1
CHRISTIAN asked on 10 Feb 2011, 03:25 PM
Hello,
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

Sort by
0
Maya
Telerik team
answered on 10 Feb 2011, 03:29 PM
Hi CHRISTIAN,

You may try to use the GridViewComboBoxColumn. Another possibility would be to define a CellTemplate for the particular column and set a RadComboBox inside.
 

Best wishes,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
CHRISTIAN
Top achievements
Rank 1
answered on 14 Feb 2011, 11:02 AM

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

0
Maya
Telerik team
answered on 14 Feb 2011, 03:43 PM
Hello CHRISTIAN,

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.
 

Best wishes,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
TreeListView
Asked by
CHRISTIAN
Top achievements
Rank 1
Answers by
Maya
Telerik team
CHRISTIAN
Top achievements
Rank 1
Share this question
or