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

TreeView and GridSplitter - not expanding

1 Answer 113 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Richard Ellis
Top achievements
Rank 1
Richard Ellis asked on 02 Mar 2011, 01:07 PM
I'm working on a RichTextBox editor which has allows the user to select a 'document' from a hierarchical tree (displayed using the RadTreeView) which then displays the document in a RadRichTextBox for editing.  The basic XAML I have so far is as below:

<Grid x:Name="documentContent"  Grid.Row="1">
            <!-- Layout -->
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            
            <!-- Column 1 -->
            <telerik:RadTreeView x:Name="documentTree" ItemsSource="{Binding Path=DocumentRefs}" BorderThickness="5" BorderBrush="BlueViolet">
                <telerik:RadTreeView.ItemTemplate>
                    <!-- Temp binding until full hierarchy sorted -->
                    <sdk:HierarchicalDataTemplate>
                        <Button Content="{Binding}" Command="{Binding Path=SelectDocument, Source={StaticResource ViewModel}}" CommandParameter="{Binding}" />
                    </sdk:HierarchicalDataTemplate>
                </telerik:RadTreeView.ItemTemplate>
            </telerik:RadTreeView>

            <!-- Column 2-->
            <sdk:GridSplitter Grid.Column="1"/>
            
            <!-- Column 3 -->
            <telerik:RadRichTextBox Name="editor" Grid.Column="2" />
        </Grid>

At this time the documents are simpler displayed in the tree as a list (of buttons).  Eventually it should be a hierarchical tree.

My problem at this time is that when the GridSplitter is moved by the user the RadTreeView does not currently change size.  I would like it to fill the space as dictated by the position of the GridSplitter, and then add scroll bars when the TreeView is larger than the horizontal and vertical space provided for it.

What do I need to do to achieve this?

1 Answer, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 07 Mar 2011, 02:25 PM
Hello Richard Ellis,

Please examine the attached solution which demonstrates both how to use telerik`s HierarchicalDatatemplates and the GridSplitter with the desired behavior. Feel free to ask if you need further assistance on this.

Kind regards,
Petar Mladenov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
TreeView
Asked by
Richard Ellis
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or