RadTreeListView and GridViewComboBoxColumn problem

4 posts, 0 answers
  1. Ram
    Ram avatar
    4 posts
    Member since:
    Apr 2012

    Posted 04 Oct 2013 Link to this post

    Hi,

    I am trying to use GridViewComboBoxColumn in a RadTreeListView, but for some reason, the combobox field is always empty. Can someone tell me what am I doing wrong?


        public class WorkItemTree
        {
            public ObservableCollection<WorkItemNode> workItems
            {
                get;
                set;
            }
       }
     
        public class WorkItemNode
        {
            public ObservableCollection<WorkItemNode> Children
            {
                get;
                set;
            }
     
            public int Id
            {
                get;
                set;
            }
     
            public string Title
            {
                get;
                set;
            }
     
            public string State
            {
                get;
                set;
            }
            public List<MyState> States
            {
                get;
                set;
            }
    }
     
        public class MyState
        {
            public string Name
            {
                get;
                set;
            }
        }
     
    this.radTreeListView.ItemsSource = TFSManager.workItems.workItems;
     
    <Window
            xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="TFSTreeView.MainWindow"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
     
            <telerik:RadTreeListView x:Name="radTreeListView"
                                     AutoGenerateColumns="False" ScrollMode="Deferred"
                                     LoadingRowDetails="radTreeListView_LoadingRowDetails"
                                     RowDetailsVisibilityMode="Visible"  Margin="0,0,0,-23"
                                     IsReadOnly="True"
                                     DataLoaded="radTreeListView_DataLoaded"
                                     >
                <telerik:RadTreeListView.ChildTableDefinitions>
                    <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
                </telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:RadTreeListView.Columns>
                    <telerik:GridViewComboBoxColumn Name="State" Header="State" DataMemberBinding="{Binding State, Mode=TwoWay}" ItemsSource="{Binding States}" DisplayMemberPath="Name" SelectedValueMemberPath="Name"/>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Title}"
                                        Header="Title" />
                </telerik:RadTreeListView.Columns>
            </telerik:RadTreeListView>
     
             
        </Grid>
    </Window>

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 07 Oct 2013 Link to this post

    Hello,

    You can check our online documentation on how to configure GridViewComboBoxColumn here. As to the empty cells, I believe that this troubleshooting article will help you to resolve the issue.

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Ram
    Ram avatar
    4 posts
    Member since:
    Apr 2012

    Posted 08 Oct 2013 Link to this post

    I am trying two things:

    1)
    <telerik:GridViewComboBoxColumn Name="BugState" Header="State" DataMemberBinding="{Binding StateId}" ItemsSourceBinding="{Binding States}" DisplayMemberPath="Name" SelectedValueMemberPath="Id"/>

    when I do this, now cell is no longer empty, but it only shows a single entry and not a combo dropdown.

    2)
    I am trying to set the ItemsSource in code, but it looks like RadTreeListView doesn't have Columns property for me to set the itemssource.
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 11 Oct 2013 Link to this post

    Hello,

    You can get a reference of the column from RadTreeListView.Columns collection.

    For example:

    GridViewComboBoxColumn column = treeList.Columns["ComboColumn"] as GridViewComboBoxColumn;
     
    Then you can assign its ItemsSource as suggested in the troubleshooting article

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top