Hi, i have I need to use a treeview where you can select only leaf elements.
For my needs I created a treeview databinding with a HierarchicalDataTemplate.
I tried to disable the intermediate nodes, but this way I are also disabled child nodes.
How can I do?
This is the XAML
For my needs I created a treeview databinding with a HierarchicalDataTemplate.
I tried to disable the intermediate nodes, but this way I are also disabled child nodes.
How can I do?
This is the XAML
<
UserControl.Resources
>
<
Style
x:Key
=
"containerStyle"
TargetType
=
"{x:Type telerik:RadTreeViewItem}"
>
<
Setter
Property
=
"IsSelected"
Value
=
"{Binding IsSelezionato, Mode=TwoWay}"
/>
<
Setter
Property
=
"IsExpanded"
Value
=
"{Binding IsEspanso, Mode=TwoWay}"
/>
<
Setter
Property
=
"IsEnabled"
Value
=
"{Binding IsAttivo, Mode=OneWay}"
/>
</
Style
>
<
HierarchicalDataTemplate
x:Key
=
"BreadMenuCrumpTemplateL1"
ItemsSource
=
"{Binding Children}"
ItemContainerStyle
=
"{StaticResource containerStyle}"
>
<
TextBlock
Text
=
"{Binding Titolo}"
Margin
=
"0"
VerticalAlignment
=
"Stretch"
/>
</
HierarchicalDataTemplate
>
</
UserControl.Resources
>
<
Grid
x:Name
=
"LayoutRoot"
>
<
telerik:RadDropDownButton
Content
=
"{Binding TitoloElemento, Mode=OneWay}"
Margin
=
"0"
>
<
telerik:RadDropDownButton.DropDownContent
>
<
telerik:RadTreeView
x:Name
=
"radTreeView"
ItemsSource
=
"{Binding TreeMenu.Children}"
ItemTemplate
=
"{StaticResource BreadMenuCrumpTemplateL1}"
IsExpandOnSingleClickEnabled
=
"True"
IsExpandOnDblClickEnabled
=
"False"
IsSingleExpandPath
=
"True"
IsDragPreviewEnabled
=
"False"
IsDragTooltipEnabled
=
"False"
BringIntoViewMode
=
"HeaderAndItems"
SelectedItem
=
"{Binding CurrentTreeItem, Mode=TwoWay}"
IsEditable
=
"False"
/>
</
telerik:RadDropDownButton.DropDownContent
>
</
telerik:RadDropDownButton
>
</
Grid
>