How to incorporate Expand and Collapse for RadTreeView implemented in codebehind using CategoryViewModel sample

1 Answer 33 Views
TreeView
jyostna
Top achievements
Rank 1
Iron
jyostna asked on 04 Feb 2022, 06:47 AM | edited on 04 Feb 2022, 06:48 AM

I have used the provided CategoryViewModel to implement RadTreeView tristate logic with checkboxes and also Enable/disable of some items by using isChecked and isEnabled properties.

Now  i need to implement Expand and Collapse when i check a parent item (subcategory item )

Could you pls suggest which events and how to use.

jyostna
Top achievements
Rank 1
Iron
commented on 04 Feb 2022, 09:07 AM

Found it

 

<Style TargetType="{x:Type telerik:RadTreeViewItem}"  BasedOn="{StaticResource RadTreeViewItemStyle}">
    <Setter Property="IsSelected" Value="{Binding Path=IsSelected,Mode=TwoWay}"  />
    <Setter Property="IsExpanded" Value="{Binding Path=IsExpanded,Mode=TwoWay}"/>
</Style>

1 Answer, 1 is accepted

Sort by
1
jyostna
Top achievements
Rank 1
Iron
answered on 04 Feb 2022, 09:07 AM
<Style TargetType="{x:Type telerik:RadTreeViewItem}"  BasedOn="{StaticResource RadTreeViewItemStyle}">
    <Setter Property="IsSelected" Value="{Binding Path=IsSelected,Mode=TwoWay}"  />
    <Setter Property="IsExpanded" Value="{Binding Path=IsExpanded,Mode=TwoWay}"/>
</Style>
Martin Ivanov
Telerik team
commented on 07 Feb 2022, 01:18 PM

Thanks for sharing the solution.
Tags
TreeView
Asked by
jyostna
Top achievements
Rank 1
Iron
Answers by
jyostna
Top achievements
Rank 1
Iron
Share this question
or