I have two treeviews in my panel.
To do: Expand the nodes upto level 2. On select parent node in the first treeview it should display the child nodes and its details in the second treeview.Onselect the parent nodes child nodes should open in a new tab/ new treeview.
Need Help!
<telerik:RadTreeListView
x:Name="Tree1"
AutoGenerateColumns="False"
ShowInsertRow="False"
RowDetailsVisibilityMode="Collapsed"
RowIndicatorVisibility="Collapsed"
EnableColumnVirtualization="True"
EnableRowVirtualization="True"
SelectionMode="Single"
SelectionUnit="Cell"
AlternationCount="2"
RowHeight="25"
FontSize="14"
FontWeight="Bold"
GroupRenderMode="Flat"
CanUserInsertRows="False"
CanUserResizeRows="False"
CanUserDeleteRows="False"
CanUserReorderColumns="False"
CanUserFreezeColumns="False"
IsExpandedBinding="{Binding IsExpanded, Mode=TwoWay}"
IsSynchronizedWithCurrentItem="False"
Grid.Row="1"
Visibility="Visible"
IsReadOnly="True"
>
<telerik:RadTreeListView.ChildTableDefinitions>
<telerik:TreeListViewTableDefinition ItemsSource="{Binding TeamCollection}" />
</telerik:RadTreeListView.ChildTableDefinitions>
<telerik:RadTreeListView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Team}"
Header="Name" IsReadOnly="True" MinWidth="100" HeaderTextAlignment="Center" />
</telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>
<telerik:RadTreeListView
x:Name="Tree1"
AutoGenerateColumns="False"
ShowInsertRow="False"
RowDetailsVisibilityMode="Collapsed"
RowIndicatorVisibility="Collapsed"
EnableColumnVirtualization="True"
EnableRowVirtualization="True"
SelectionMode="Single"
SelectionUnit="Cell"
AlternationCount="2"
RowHeight="25"
FontSize="14"
FontWeight="Bold"
GroupRenderMode="Flat"
CanUserInsertRows="False"
CanUserResizeRows="False"
CanUserDeleteRows="False"
CanUserReorderColumns="False"
CanUserFreezeColumns="False"
IsExpandedBinding="{Binding IsExpanded, Mode=TwoWay}"
IsSynchronizedWithCurrentItem="False"
Grid.Row="1"
Visibility="Visible"
IsReadOnly="True"
>
<telerik:RadTreeListView.ChildTableDefinitions>
<telerik:TreeListViewTableDefinition ItemsSource="{Binding TeamCollection}" />
</telerik:RadTreeListView.ChildTableDefinitions>
<telerik:RadTreeListView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Team}"
Header="Name" IsReadOnly="True" MinWidth="100" HeaderTextAlignment="Center" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding City}"
Header="City" IsReadOnly="True" MinWidth="100" HeaderTextAlignment="Center" />
</telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>
First of all, both TreeViews are bound to the same ItemsSources (and have the same Name, which doesn't even compile...). You'll want to bind the second TreeView to another collection, and modify that collection depending on the first TreeView's SelectedItem.
In your DataContext, set
ChildTeamCollection
whenSelectedParentItem
changes.As for the last part of your question... I still don't understand what you mean with "new tab \ new treeview". Do you mean a completely new TreeView in a different place? Or you mean the second TreeView in your example?