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

Collapse the expand hierarchy button

4 Answers 98 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Rotem
Top achievements
Rank 1
Rotem asked on 02 Aug 2011, 04:45 PM

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?

4 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 02 Aug 2011, 05:04 PM
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 >>

0
Rotem
Top achievements
Rank 1
answered on 02 Aug 2011, 06:22 PM

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?
0
Accepted
Vanya Pavlova
Telerik team
answered on 03 Aug 2011, 07:52 AM
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 >>

0
Rotem
Top achievements
Rank 1
answered on 07 Aug 2011, 09:31 AM

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.

Tags
TreeListView
Asked by
Rotem
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Rotem
Top achievements
Rank 1
Share this question
or