How to set node height

6 posts, 0 answers
  1. James
    James avatar
    47 posts
    Member since:
    Jun 2009

    Posted 16 Jun 2009 Link to this post

    the default node height is wasteful of space. How can I set node height? Thanks
  2. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 17 Jun 2009 Link to this post

    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.
  3. DevCraft banner
  4. Andreas
    Andreas avatar
    12 posts
    Member since:
    Jun 2012

    Posted 23 Jun 2011 Link to this post

    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

  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 28 Jun 2011 Link to this post

    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
  6. Andreas
    Andreas avatar
    12 posts
    Member since:
    Jun 2012

    Posted 28 Jun 2011 Link to this post

    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
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 30 Jun 2011 Link to this post

    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
Back to Top
DevCraft banner