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

[Solved] How to set node height

5 Answers 369 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
James
Top achievements
Rank 1
James asked on 17 Jun 2009, 03:53 AM
the default node height is wasteful of space. How can I set node height? Thanks

5 Answers, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 17 Jun 2009, 06:08 AM
Hello James,

All you need to do in order to set the height of RadTreeView items is:

1.Add appropriate style in the resources:

<UserControl.Resources>
        <Style TargetType="telerik:RadTreeViewItem" x:Key="TreeViewItemStyle">
            <Setter Property="MinHeight" Value="250"></Setter>
        </Style>
    </UserControl.Resources>

2. Set ItemContainerStyle property of the RadTreeView:

<telerik:RadTreeView ItemContainerStyle="{StaticResource TreeViewItemStyle}" .../>

I hope that this answers your question.

Greetings,
Boryana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Andreas
Top achievements
Rank 1
answered on 23 Jun 2011, 11:34 AM
Hello 

I've tried the suggested solution but the MinHeight property that is changing is in the RadTreeViewItem
which I believe is not the desired one. As a result the tree height is reduced to the x value of the property
and all child nodes are not visible any more.

Instead I would like to change the height of the Grid named: HeaderRow (as shown in the xap file)
inside  RadTreeViewItem for every node in the tree. Is this possible?

Thanks

0
Petar Mladenov
Telerik team
answered on 28 Jun 2011, 11:03 AM
Hello Andreas,

The default Height of the RadTreeViewItem is 24. I prepared a sample for you that changes it to 15 using the approach suggested by Boryana. Could you please give it a try and let us know if this is what you expect? You can also elaborate more on your case so that we could advice you better.
Thank you in advance for your cooperation.

Kind regards,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Andreas
Top achievements
Rank 1
answered on 28 Jun 2011, 01:08 PM
Thank you! The example project is very clear and solved my problem.
Can you also please advice me how to reduce the tab space
when expanding a tree node (IndentContainer's width)?

Thanks
0
Petar Mladenov
Telerik team
answered on 30 Jun 2011, 04:36 PM
Hi Andreas,

You can use the ItemsIdent property of the RadTreeView like so:
<telerik:RadTreeView x:Name="tree"
                             Width="300"
                             ItemsIndent="10"
                             ItemContainerStyle="{StaticResource TreeViewItemStyle}"
                            >
Let us know if you need further assistance.

All the best,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
James
Top achievements
Rank 1
Answers by
Bobi
Telerik team
Andreas
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or