TreeViewItem horizontal stretch problem

3 posts, 1 answers
  1. Nikolay Velizhanin
    Nikolay Velizhanin avatar
    13 posts
    Member since:
    Feb 2010

    Posted 04 Feb 2010 Link to this post

    ItemContainer go outside (right) of the tree. Version 2009.3.1322.1030

    XAML:

    <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:local="clr-namespace:SilverlightApplication1"
            xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" x:Class="SilverlightApplication1.MainPage">
        <UserControl.Resources>

        </UserControl.Resources>
        <Grid x:Name="LayoutRoot">
            <telerikNavigation:RadTreeView x:Name="treeView1"
                ScrollViewer.HorizontalScrollBarVisibility ="Disabled"
                ScrollViewer.VerticalScrollBarVisibility="Auto">
                <telerikNavigation:RadTreeViewItem Header="Item 0"/>
                <telerikNavigation:RadTreeViewItem Header="Item 1"/>
                <telerikNavigation:RadTreeViewItem Header="Item 2">
                    <telerikNavigation:RadTreeViewItem>
                        <telerikNavigation:RadTreeViewItem.Header>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Text="This is a very long header of a RadTreeViewItem. This is a very long header of a RadTreeViewItem. This is a very long header of a RadTreeViewItem. This is a very long header of a RadTreeViewItem." />
                                <TextBlock Text="This is a very long header of a RadTreeViewItem. This is a very long header of a RadTreeViewItem. This is a very long header of a RadTreeViewItem. This is a very long header of a RadTreeViewItem." />
                            </StackPanel>
                        </telerikNavigation:RadTreeViewItem.Header>
                    </telerikNavigation:RadTreeViewItem>
                </telerikNavigation:RadTreeViewItem>
                <telerikNavigation:RadTreeViewItem Header="Item 3"/>
            </telerikNavigation:RadTreeView>
        </Grid>
    </UserControl>

    In version 2009.2.812.1030 all fine.
  2. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 09 Feb 2010 Link to this post

    Hello Nikolay Velizhanin,

    If you want to accomplish the desired functionality then you have to change the ItemPanel of RadTreeViewItem. Please find attached  project. Its you can see how to change the panel.

    If you have further  questions please do not hesitate to ask us.

    I hope this will help you.

    Kind regards,
    Dimitrina
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  3. Nikolay Velizhanin
    Nikolay Velizhanin avatar
    13 posts
    Member since:
    Feb 2010

    Posted 09 Feb 2010 Link to this post

    Thanks! It works.
Back to Top