Top docked split container to fit its content

3 posts, 0 answers
  1. Ciprian Bortos
    Ciprian Bortos avatar
    5 posts
    Member since:
    Apr 2010

    Posted 29 Apr 2010 Link to this post

    Hi

    Would you please instruct me on how to make a top docked RadSplitContainer adjust its height to fit its content?
    Here is my XAML:

    <UserControl x:Class="TelerikTests.MainPage" 
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
                 xmlns:radDock="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking">  
     
        <radDock:RadDocking> 
            <radDock:RadDocking.DocumentHost> 
                <TextBlock Text="Document here" /> 
            </radDock:RadDocking.DocumentHost> 
     
            <radDock:RadSplitContainer InitialPosition="DockedTop" Background="Red">  
                <radDock:RadPaneGroup VerticalAlignment="Top" Background="Yellow" > 
                    <radDock:RadPane CanDockInDocumentHost="False" CanUserClose="False" Header="Top panel" CanUserPin="False" Background="Blue" > 
     
                        <Grid Background="White" VerticalAlignment="Top">  
                            <TextBlock Text="Top panel content" Margin="5" /> 
                        </Grid> 
     
                    </radDock:RadPane> 
                </radDock:RadPaneGroup> 
            </radDock:RadSplitContainer> 
     
            <radDock:RadSplitContainer Orientation="Vertical" InitialPosition="DockedRight" Width="300">  
     
                <radDock:RadPaneGroup> 
                    <radDock:RadPane CanDockInDocumentHost="False" CanUserClose="False" Header="Style Elements"></radDock:RadPane> 
                </radDock:RadPaneGroup> 
     
                <radDock:RadPaneGroup> 
                    <radDock:RadPane CanDockInDocumentHost="False" CanUserClose="False" Header="Properties">  
                    </radDock:RadPane> 
                </radDock:RadPaneGroup> 
     
            </radDock:RadSplitContainer> 
     
        </radDock:RadDocking> 
     
    </UserControl> 
     


    If you run it, you will see that the height of the RadSplitContainer (with the Red background) is larger than the height of its content. I would like to make it shrink so it is only large enough to fits its content.

    Thanks.
  2. Ciprian Bortos
    Ciprian Bortos avatar
    5 posts
    Member since:
    Apr 2010

    Posted 30 Apr 2010 Link to this post

    Does it make any sense what I'm asking?
    I would really hope to find a solution other than hard-coding the height of the RadSplitContainer.

    Anyone?  Thanks.
  3. DevCraft banner
  4. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 04 May 2010 Link to this post

    Hi Ciprian,

     Currently this feature is not supported by the Docking control. What I would suggest you is to track the SizeChanged event of the Grid, that holds the content of the pane and any time it changes to find the corresponding SplitContainer and change its Height.

    Sincerely yours,
    Miroslav Nedyalkov
    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