Collapse the expand hierarchy button

5 posts, 1 answers
  1. Rotem
    Rotem avatar
    25 posts
    Member since:
    Sep 2010

    Posted 02 Aug 2011 Link to this post

    Hi,

    I want to collapse the hierarchy expand button (its border container to be accurate) so there will be no white space at the first column content when there is no hierarchy.

     

    I saw that there is a property in the radTreeListView called HasHierarchy, but I cannot change its value (the set is not accessible).

    I’ve managed to this in code:

                var gridHierarchyBorder = treeListView.FindChildByName("PART_HierarchyIndent") as Border;

                if (gridHierarchyBorder == null)

                    return;

     

                gridHierarchyBorder.Visibility = Visibility.Collapsed;

     

    But I guess there is a more efficient and elegant way to achieve this. Is there?

  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 02 Aug 2011 Link to this post

    Hello Rotem,

     
    I would not encourage you to clear the indentation in a TreeListViewRow in such manner. RadTreeListView directly inherits RadGridView and it is designed to display data in a hierarchical manner. If you do not need this indentation why not use our RadGridView control instead?  


    Kind regards,
    Vanya Pavlova
    the Telerik team

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

  3. UI for WPF is Visual Studio 2017 Ready
  4. Rotem
    Rotem avatar
    25 posts
    Member since:
    Sep 2010

    Posted 02 Aug 2011 Link to this post

    Hi Vanya,

    I’m familiar with the RadGridView control. I chose to use RadTreeListView because I need its functionality only sometimes.

    So how should I implement this requirement?
  5. Answer
    Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 03 Aug 2011 Link to this post

    Hello Rotem,

     

    You may achieve the desired result on the UI level through predefinig the template of TreeListViewRow. Just remove the GridViewToggleButton and change the position of the DataCellsPresenter, which is responsible for displaying GridViewCells.



    Please find attached an example which demonstrates how this can be achieved.  


    Kind regards,
    Vanya Pavlova
    the Telerik team

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

  6. Rotem
    Rotem avatar
    25 posts
    Member since:
    Sep 2010

    Posted 07 Aug 2011 Link to this post

    Thanks Vanya,
    The solution you gave is not a complete solution, because the cells border is not aligned with the header border, but the solution is good enough for me. (I don't need the headers).

    Again, thank you.

Back to Top
UI for WPF is Visual Studio 2017 Ready