Row Height

8 posts, 0 answers
  1. DOCS
    DOCS avatar
    7 posts
    Member since:
    Aug 2010

    Posted 14 Oct 2010 Link to this post

    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.
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 15 Oct 2010 Link to this post

    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
  3. DevCraft banner
  4. DOCS
    DOCS avatar
    7 posts
    Member since:
    Aug 2010

    Posted 18 Oct 2010 Link to this post

    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. 
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 18 Oct 2010 Link to this post

    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
  6. DOCS
    DOCS avatar
    7 posts
    Member since:
    Aug 2010

    Posted 18 Oct 2010 Link to this post

    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.
  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 21 Oct 2010 Link to this post

    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
  8. mark
    mark avatar
    3 posts
    Member since:
    Jun 2012

    Posted 24 Oct 2010 Link to this post

    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?
  9. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 25 Oct 2010 Link to this post

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