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

How to set the expander visibility for a RadTreeViewItem

1 Answer 197 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Balaram Barange
Top achievements
Rank 1
Balaram Barange asked on 14 Oct 2011, 06:41 AM
Hi,

My requirement is to set the visibility of RadTreeViewItem. For this sample shared at the http://www.telerik.com/community/forums/wpf/treeview/radtreeviewitem-visibility.aspx post helped me. I modified this sample to incorporate my requirement. I added one more property in BusinessItem for Visibility and bind it with the RadTreeViewItem. But problem is that RadTreeViewItem shows expander button (on left side) even if all its children are set to Collapsed.
I also need to hide expander button for a RadTreeViewItem if all its children are collapsed.


Thanks and Regards,
Bala,

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 18 Oct 2011, 04:23 PM
Hi Balaram Barange,

 I modified the mentioned solution to meet your requirement. Basically I iterate over the "Items" collection of the BusinessItem on CollectionChanged event and check whether all child items are collapsed. If  yes, I se boolean property from to true in the BusinesItem. This bool property is bind to the ExpanderStyle property of the RadtreeViewitem via Converter. Please let us know if this approach satisfies you.

All the best,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TreeView
Asked by
Balaram Barange
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or