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

RadTreeListView and GridViewComboBoxColumn problem

3 Answers 64 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Ram
Top achievements
Rank 1
Ram asked on 04 Oct 2013, 07:48 PM
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>

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 07 Oct 2013, 05:58 AM
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 >>
0
Ram
Top achievements
Rank 1
answered on 08 Oct 2013, 07:51 PM
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.
0
Dimitrina
Telerik team
answered on 11 Oct 2013, 12:03 PM
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 >>
Tags
TreeListView
Asked by
Ram
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Ram
Top achievements
Rank 1
Share this question
or