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

TreeViewItem horizontal stretch problem

2 Answers 164 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Nikolay Velizhanin
Top achievements
Rank 1
Nikolay Velizhanin asked on 04 Feb 2010, 07:45 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 09 Feb 2010, 09:21 AM
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.
0
Nikolay Velizhanin
Top achievements
Rank 1
answered on 09 Feb 2010, 11:15 AM
Thanks! It works.
Tags
TreeView
Asked by
Nikolay Velizhanin
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Nikolay Velizhanin
Top achievements
Rank 1
Share this question
or