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

Row Height

7 Answers 65 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
DOCS
Top achievements
Rank 1
DOCS asked on 14 Oct 2010, 11:02 PM
Is there a simple way to modify the height of the rows in the RadTreeListView control? I've seen examples of creating Control Templates, but this seems awfully convoluted. I find it very difficult to determine how to manipulate the control.

7 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 15 Oct 2010, 08:19 AM
Hello Sandy,

Have you tried setting the RowHeight property of the RadTreeListView?

Regards,
Veselin Vasilev
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
DOCS
Top achievements
Rank 1
answered on 18 Oct 2010, 07:24 AM
I am using the Silverlight 3 version of the RadTreeListView control. I can only guess this is the reason that the RowHeight property is not supported. I also need to set the indentation of the children nodes. 
0
Tina Stancheva
Telerik team
answered on 18 Oct 2010, 05:08 PM
Hello Sandy,

Thank you for your clarification. Indeed the RowHeight property isn't supported in the SL3 version of the RadTreeListView control. However, if the control is databound, you can control the Height of the rows through the CellTemplate of each column. For example, you can try the following:
<telerikNavigation:RadTreeListView x:Name="myTreeListView" VerticalAlignment="Top" HorizontalAlignment="Left"
                ItemTemplate="{StaticResource RootTemplate}" IsLineEnabled="True" IsEditable="True">
    <telerikNavigation:RadTreeListView.Columns>
        <telerikNavigation:RadColumn Header="Last Name" Width="200">
            <telerikNavigation:RadColumn.CellTemplate>
                <DataTemplate>
                    <Grid Height="50">
                        <TextBlock Text="{Binding LastName}" VerticalAlignment="Center"/>
                    </Grid>
                </DataTemplate>
            </telerikNavigation:RadColumn.CellTemplate>
        </telerikNavigation:RadColumn>
    </telerikNavigation:RadTreeListView.Columns>
</telerikNavigation:RadTreeListView>
I attached a sample implementation if this approach. Give it a try and let us know if it works for you.

As for the items indent, unfortunately, the RadTreeListView for SL3 control doesn't support such feature. However, the RadTreeListView control implementation for SL4 inherits the RadGridView control thus further extending the functionality of the control. You can check it out in our online demos.

Kind regards,
Tina Stancheva
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
DOCS
Top achievements
Rank 1
answered on 19 Oct 2010, 03:07 AM
Unfortunately, the cell template will not allow you to decrease the default minimum row height. If I change the height to 5, for example, the text is cropped and the actual row is still the same height. I am trying to decrease the space between the rows, but it seems that this is impossible.
0
Tina Stancheva
Telerik team
answered on 21 Oct 2010, 12:02 PM
Hello Sandy,

In the SL3 version of the RadTreeListView you can apply a CellContainerStyle to the columns cells, like so:
<telerikNavigation:RadColumn Header="First Name" Width="200"
    CellTemplate="{StaticResource EmployeeTemplate}" CellContainerStyle="{StaticResource CellStyle}"/>

And you can modify the CellStyle to set a Cell Height property thus affecting the TreeListView rows. I modified the project to implement this approach. Give it a try and let us know how it goes.

Also, you can have a look at this forum post which might also help you further customize the control.

Greetings,
Tina Stancheva
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
mark
Top achievements
Rank 1
answered on 25 Oct 2010, 01:00 AM
I am using a GridViewDataColumn and it does not have CellContainerStyle. I am using SL4. What is the recommened approach with the GridViewDataColumn in order to shrink the RowHeight?
0
Milan
Telerik team
answered on 25 Oct 2010, 07:20 AM
Hello mark,

If you are using the Silverlight 4 version then you should use the RowHeight property of RadTreeListView to shrink the height of the rows.


Sincerely yours,
Milan
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
TreeListView
Asked by
DOCS
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
DOCS
Top achievements
Rank 1
Tina Stancheva
Telerik team
mark
Top achievements
Rank 1
Milan
Telerik team
Share this question
or