ComboBox in TreeListView

4 posts, 0 answers
  1. CHRISTIAN
    CHRISTIAN avatar
    39 posts
    Member since:
    Nov 2010

    Posted 10 Feb 2011 Link to this post

    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
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 10 Feb 2011 Link to this post

    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>>
  3. DevCraft banner
  4. CHRISTIAN
    CHRISTIAN avatar
    39 posts
    Member since:
    Nov 2010

    Posted 14 Feb 2011 Link to this post

    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

  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 14 Feb 2011 Link to this post

    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>>
Back to Top