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

RadSplitContainer height setting

3 Answers 261 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Aurore
Top achievements
Rank 1
Aurore asked on 07 Jun 2010, 04:06 PM
Hello,

I'd like to set the height of a radsplitter container.

<telerik:RadSplitContainer InitialPosition="FloatingOnly" x:Name="ZoomContainer" > 
                <telerik:RadPaneGroup  > 
                    <telerik:RadPane CanDockInDocumentHost="False" CanUserClose="True" x:Name="paneZoom"   
                          Header="Zoom" > 
                            <Grid> 
  <myoject Width="200" Height="200"/> 
</Grid> 
</telerik:RadPane> 
<telerik:RadSplitContainer> 

My object has a fixed size, I'd like the RadSplitContainer to have the same....

And finally I don't want the user can resize splitcontainer. have you a property to do that ?

Thanks Aurore

3 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 09 Jun 2010, 12:29 PM
Hi Aurore,

 What you need to do is to set the Width and Height properties of the ToolWindow control (not the SplitContainer) and to disable resizing it. Unfortunately you cannot stop the resizing cursors of the TooWindow, but you could set Min and Max width and height to it and this will not let the user to actually change the size.

Finding the ToolWindow is a little tricky - you must go up the visual tree starting from the RadPane or its content and find the ToolWindow control and set it up. You can use the Loaded event of the content of the pane for this purpose. Here is a small example of what I mean:

private void Rectangle_Loaded(object sender, RoutedEventArgs e)
{
    var content = sender as FrameworkElement;
    var window = content.ParentOfType<ToolWindow>();
    if (window != null)
    {
        window.MinHeight = window.MaxHeight = content.Height + 28; // +28 for the borders and header
        window.MinWidth = window.MaxWidth = content.Width + 12; // +12 for the borders
    }
}

This handler is hooked-up to the content of one of the panes which is a Rectangle in my case.

Hope this helps!

Kind regards,
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.
0
Binyamin
Top achievements
Rank 1
answered on 05 Apr 2011, 01:16 PM
I've tried this, but the ToolWindow is always null. Is there any other way to set the minWidth of floating radPane?
0
Yana
Telerik team
answered on 11 Apr 2011, 10:07 AM
Hello Binyamin,

I've tested the provided code and it works without a problem at our side, you can find my test project attached. Can you please download it and give it a try? What is different in your case?

Regards,
Yana
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
Aurore
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Binyamin
Top achievements
Rank 1
Yana
Telerik team
Share this question
or