TreeView and GridSplitter - not expanding

2 posts, 1 answers
  1. Richard Ellis
    Richard Ellis avatar
    26 posts
    Member since:
    Mar 2010

    Posted 02 Mar 2011 Link to this post

    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:

    Snippet
    <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?
  2. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 07 Mar 2011 Link to this post

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