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

Top docked split container to fit its content

2 Answers 46 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Ciprian Bortos
Top achievements
Rank 1
Ciprian Bortos asked on 29 Apr 2010, 04:10 PM
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 Answers, 1 is accepted

Sort by
0
Ciprian Bortos
Top achievements
Rank 1
answered on 30 Apr 2010, 09:04 PM
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.
0
Miroslav Nedyalkov
Telerik team
answered on 04 May 2010, 12:04 PM
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.
Tags
Docking
Asked by
Ciprian Bortos
Top achievements
Rank 1
Answers by
Ciprian Bortos
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Share this question
or