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

Change height of rows

3 Answers 246 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Tao Jiang
Top achievements
Rank 1
Tao Jiang asked on 31 Oct 2009, 03:38 AM
Hi,

I am implementing a treeview with a collection. I want to adjust the height of rows, want thinner and it does not occupy a lot of space.

How can I do it?

Thanks,

3 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 01 Nov 2009, 08:27 AM
Hello Tao Jiang,

You need to set the MinHeight property. By default it is 24.

Best wishes,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Tao Jiang
Top achievements
Rank 1
answered on 02 Nov 2009, 04:39 PM

Hi, Valentin.Stoychev
I tried it, but the row still keeps the same height, no matter what I do. The Grid's height still keep the same.
Any advice?
Thanks,


</

 

HierarchicalDataTemplate.Resources>

 

 

 

<StackPanel>

 

 

 

<Grid ToolTipService.ToolTip = "{Binding TooltipText}" MinHeight="15">

 

 

 

<Grid.RowDefinitions>

 

 

 

<RowDefinition Height="Auto" MinHeight="15"/>

 

 

 

</Grid.RowDefinitions>

 

 

 

<Grid.ColumnDefinitions>

 

 

 

<ColumnDefinition Width="200"/>

 

 

 

<ColumnDefinition Width="350"/>

 

 

 

<ColumnDefinition Width="350"/>

 

 

 

<ColumnDefinition Width="350"/>

 

 

 

<ColumnDefinition Width="350"/>

 

 

 

<ColumnDefinition Width="*"/>

 

 

 

</Grid.ColumnDefinitions>

 

 

 

<Border BorderBrush="Black" Height="15" Tag="{Binding Path=Sample, Mode=TwoWay}" BorderThickness="1, 0.5, 0, 0.5" Grid.Column="0"/>

 

 

 

<Border BorderBrush="Black" Height="15" Tag="{Binding Path=Sample, Mode=TwoWay}" BorderThickness="1,0.5,1,0.5" Grid.Column="1" />

 

 

 

<TextBlock Grid.Column="0" Margin="0,0,0,0" Height="15" Text="{Binding Path=Name, Mode=TwoWay}" />

 

 

 

<TextBlock Grid.Column="1" Margin="0,0,0,0" Height="15" Text="{Binding Path=Sample, Mode=TwoWay}" />

 

 

 

</Grid>

 

 

 

</StackPanel>

 

 

 

</HierarchicalDataTemplate>


 

 

 

<Border Grid.Row="1" Name="treeviewBorder" BorderBrush="#FF000000" CornerRadius="1" BorderThickness="1" Background="#FFFFFFFF" MinHeight="15">

 

 

 

 

 

 

<Telerik:RadTreeView x:Name="treeView1" ExpanderStyle="{StaticResource Expander}" IsEditable="true" HorizontalAlignment="Left"

 

 

 

 

 

VerticalAlignment="Top" IsLineEnabled="True" ScrollViewer.VerticalScrollBarVisibility="Auto" MinHeight="15" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.CanContentScroll="True" Selected="treeView1_Selected" ItemPrepared="treeView1_ItemPrepared"

 

 

 

 

 

ItemTemplate="{DynamicResource Element}">

 

 

 

 

 

 

<Telerik:RadTreeView.ItemEditTemplate>

 

 

 

 

 

 

<HierarchicalDataTemplate>

 

 

 

 

 

 

 

<StackPanel Orientation="Horizontal">

 

 

 

 

 

 

<Grid ToolTipService.ToolTip = "{Binding TooltipText}" MinHeight="15">

 

 

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

 

 

<RowDefinition Height="Auto" MinHeight="15"/>

 

 

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

 

 

<ColumnDefinition Width="300"/>

 

 

 

 

 

 

<ColumnDefinition Width="300"/>

 

 

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

 

 

<Border BorderBrush="Black" Height="15" Tag="{Binding Path=Sample, Mode=TwoWay}" BorderThickness="1, 0.5, 0, 0.5" Grid.Column="0"/>

 

 

 

 

 

 

<Border BorderBrush="Black" Height="15" Tag="{Binding Path=Sample, Mode=TwoWay}" BorderThickness="1,0.5,1,0.5" Grid.Column="1" />

 

 

 

 

 

 

 

 

 

<TextBlock Grid.Column="0" Margin="0,0,0,0" Height="15" Text="{Binding Path=Name, Mode=TwoWay}" />

 

 

 

 

 

 

<TextBlock Grid.Column="1" Margin="0,0,0,0" Height="15" Text="{Binding Path=Sample, Mode=TwoWay}" />

 

 

 

 

 

 

 

 

 

</Grid>

 

 

 

 

 

 

</StackPanel>

 

 

 

 

 

 

</HierarchicalDataTemplate>

 

 

 

 

 

 

</Telerik:RadTreeView.ItemEditTemplate>

 

 

 

 

 

 

</Telerik:RadTreeView>

 

0
Dimitrina
Telerik team
answered on 05 Nov 2009, 01:11 PM
Hello Tao Jiang,

Please find attached an example.

If you have any further question please do not hesitate to ask.

I hope this will help you.

All the best,

Dimitrina
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TreeView
Asked by
Tao Jiang
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Tao Jiang
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or