How to set the expander visibility for a RadTreeViewItem

2 posts, 0 answers
  1. Balaram Barange
    Balaram Barange avatar
    28 posts
    Member since:
    Apr 2009

    Posted 14 Oct 2011 Link to this post


    My requirement is to set the visibility of RadTreeViewItem. For this sample shared at the 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,
  2. Petar Mladenov
    Petar Mladenov avatar
    3151 posts

    Posted 18 Oct 2011 Link to this post

    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 >>

Back to Top