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

RadSplitContainer disable resizing

8 Answers 615 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 02 Oct 2014, 12:12 PM
Dear Telerik support,

In my project I have 3 RadSplitContainer and I would like if one of these not able to resize, I dont want to appear the resize arrow (this is a panel which contains buttons).
I tried this, but this disable all container resizing:

<telerik:RadDocking.Resources>
   <Style TargetType="telerik:RadGridResizer">
      <Setter Property="IsHitTestVisible" Value="False" />
   </Style>
</telerik:RadDocking.Resources>

I tried if set the min/max height, but when I load back the layout the panel will be resizable again (I use layout save and load).

The base of the code:
<telerikDocking:RadDocking >
            <telerikDocking:RadDocking.DocumentHost>  
                <telerikDocking:RadSplitContainer>
                    <telerikDocking:RadPaneGroup>
                        <telerikDocking:RadPane BorderThickness="0" CanUserClose="False" CanFloat="False" CanUserPin="False" >
                            <!-Content->
                        </telerikDocking:RadPane>
                         
                        <telerikDocking:RadPane BorderThickness="0" CanUserClose="False" CanFloat="False" CanUserPin="False" >
                            <!-Content->
                        </telerikDocking:RadPane>
                         
                        <telerikDocking:RadPane BorderThickness="0" CanUserClose="False" CanFloat="False" CanUserPin="False" >
                            <!--Content-->   
                        </telerikDocking:RadPane>
 
                        <telerikDocking:RadPane BorderThickness="0" CanUserClose="False" CanFloat="False" CanUserPin="False" >
                            <!-Content->
                        </telerikDocking:RadPane>
                    </telerikDocking:RadPaneGroup>
                     
                </telerikDocking:RadSplitContainer>
            </telerikDocking:RadDocking.DocumentHost>
            <telerikDocking:RadSplitContainer InitialPosition="DockedBottom" telerikDocking:DockingPanel.InitialSize="400,200">
                <telerikDocking:RadPaneGroup>
                    <telerikDocking:RadPane CanUserClose="False" CanFloat="True" CanUserPin="True" IsPinned="True">
                        <!-Content->
                    </telerikDocking:RadPane>
                </telerikDocking:RadPaneGroup>
            </telerikDocking:RadSplitContainer>
            <telerikDocking:RadSplitContainer InitialPosition="DockedBottom" Height="60" VerticalAlignment="Center" VerticalContentAlignment="Center" MaxHeight="60" MinHeight="60">
                <telerikDocking:RadPaneGroup Padding="0" VerticalAlignment="Center" VerticalContentAlignment="Center" >
                    <telerikDocking:RadPane PaneHeaderVisibility="Collapsed" BorderThickness="0" CanUserClose="False" CanFloat="False" Height="60" CanDockInDocumentHost="False" CanUserPin="False" IsPinned="True"  >
                        <!--Not dockable not resizable content-->
                    </telerikDocking:RadPane>
                </telerikDocking:RadPaneGroup>
            </telerikDocking:RadSplitContainer>
</telerikDocking:RadDocking>

Is there any possibility to disable resizing, or how can I solve this problem?

Thanks,
Rob

8 Answers, 1 is accepted

Sort by
0
Accepted
Kalin
Telerik team
answered on 06 Oct 2014, 10:15 AM
Hi Robert,

What I can suggest you in order to be able to disable the resizing of only one particular SplitContainer, would be to get the resizer in the code behind and set its IsHitTestVisible property to false. You can do that in the Loaded event handler of the Docking control, however in your case this will only affect the Resizer above the SplitContainer - you might also need disable the GridResizer of the SplitContainer below the desired one. I have prepared and attached a sample project demonstrating the explained and disabling the both GridResizers, note that you would also need consider the scenarios when the Panes are docked/undocked and manually disable the GridResizers again.

Hope this helps.

Regards,
Kalin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Robert
Top achievements
Rank 1
answered on 07 Oct 2014, 12:33 PM
Hi Kalin,

Thank you for your reply, the code is works, BUT unfortunately not works for me because I use the RadDocking.SaveLayout/LoadLayout, and when I load the saved layout, I can change the height of my "not resizable content".

Any idea, what is the problem with it?

Thanks,
Rob
0
Kalin
Telerik team
answered on 08 Oct 2014, 12:51 PM
Hello Robert,

Can you share some more details regarding the exact problem? I tested the same same scenario using the Save/Load mechanism of the control and was not able to resize the non resizable content after the reload as expected.

I'm looking forward to hearing from you.

Regards,
Kalin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Robert
Top achievements
Rank 1
answered on 09 Oct 2014, 07:41 AM
Hello Kalin,

I create a test app based on your code and its not working, the NonResizable is resizable after reload.

Here are the codes:
MainWindow.xaml
<Window x:Class="gridtest2.MainWindow"
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"
        Title="MainWindow" Height="350" Width="525" Closed="MainWindow_OnClosed" Loaded="MainWindow_OnLoaded">
    <Grid>
        <telerik:RadDocking Loaded="FrameworkElement_OnLoaded" x:Name="radDocking">
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                    <telerik:RadPaneGroup>
                        <telerik:RadPane telerik:RadDocking.SerializationTag="Pane1" BorderThickness="0" CanUserClose="False" CanFloat="False" CanUserPin="False" Header="1" >
 
                        </telerik:RadPane>
 
                        <telerik:RadPane telerik:RadDocking.SerializationTag="Pane2" BorderThickness="0" CanUserClose="False" CanFloat="False" CanUserPin="False" Header="2">
 
                        </telerik:RadPane>
 
                        <telerik:RadPane telerik:RadDocking.SerializationTag="Pane3" BorderThickness="0" CanUserClose="False" CanFloat="False" CanUserPin="False" Header="3">
 
                        </telerik:RadPane>
 
                        <telerik:RadPane telerik:RadDocking.SerializationTag="Pane4" BorderThickness="0" CanUserClose="False" CanFloat="False" CanUserPin="False" Header="4">
 
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
 
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
            <telerik:RadSplitContainer x:Name="splitContainer" InitialPosition="DockedBottom" telerik:DockingPanel.InitialSize="400,200">
                <telerik:RadPaneGroup>
                    <telerik:RadPane telerik:RadDocking.SerializationTag="splitCon" CanUserClose="False" CanFloat="True" CanUserPin="True" IsPinned="True">
 
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer x:Name="NonResizable" InitialPosition="DockedBottom" Height="60" VerticalAlignment="Center" VerticalContentAlignment="Center" MaxHeight="60" MinHeight="60">
                <telerik:RadPaneGroup Padding="0" VerticalAlignment="Center" VerticalContentAlignment="Center" >
                    <telerik:RadPane telerik:RadDocking.SerializationTag="buttonPane" PaneHeaderVisibility="Collapsed" BorderThickness="0" CanUserClose="False" CanFloat="False" Height="60" CanDockInDocumentHost="False" CanUserPin="False" IsPinned="True"  >
                        <StackPanel Orientation="Horizontal" Margin="5">
                            <Button Height="25" Width="50" Margin="5">1</Button>
                            <Button Height="25" Width="50" Margin="5">2</Button>
                            <Button Height="25" Width="50" Margin="5">3</Button>
                            <Button Height="25" Width="50" Margin="5">4</Button>
                        </StackPanel>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
    </Grid>
</Window>

MainWindowx.xaml.cs
using System;
using System.IO;
using System.IO.IsolatedStorage;
using System.Windows;
using Telerik.Windows.Controls.Docking;
 
namespace gridtest2
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void FrameworkElement_OnLoaded(object sender, RoutedEventArgs e)
        {
            var resizer = this.NonResizable.Template.FindName("DockResizer", this.NonResizable) as RadGridResizer;
            resizer.IsHitTestVisible = false;
 
            //resizer = this.NonResizable.Template.FindName("DockResizer", this.splitContainer) as RadGridResizer;
            //resizer.IsHitTestVisible = false;
        }
 
        private string SaveLayout()
        {
            string xml;
            using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForAssembly())
            {
                using (var isoStream = storage.OpenFile("RadDocking_Layout.xml", FileMode.Create))
                {
                    this.radDocking.SaveLayout(isoStream);
                    isoStream.Seek(0, SeekOrigin.Begin);
                    StreamReader reader = new StreamReader(isoStream);
                    xml = reader.ReadToEnd();
                }
            }
            return xml;
        }
 
        private void LoadLayout()
        {
            using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForAssembly())
            {
                if (storage.FileExists("RadDocking_Layout.xml"))
                {
                    using (var isoStream = storage.OpenFile("RadDocking_Layout.xml", FileMode.Open))
                    {
                        this.radDocking.LoadLayout(isoStream);
                    }
                }
            }
        }
 
        private void MainWindow_OnClosed(object sender, EventArgs e)
        {
            SaveLayout();
        }
 
        private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            LoadLayout();
        }
    }
}

Am I doing something wrong?

Thanks,
Rob
0
Accepted
Kalin
Telerik team
answered on 09 Oct 2014, 11:06 AM
Hi Robert,

Try setting a SerilizationTag to the NonResizable SplitContainer as shown below:

<telerik:RadSplitContainer x:Name="NonResizable" telerik:RadDocking.SerializationTag="NonResizableSplitContainer" InitialPosition="DockedBottom" Height="60" VerticalAlignment="Center" VerticalContentAlignment="Center" MaxHeight="60" MinHeight="60">

This way the SplitContainer will be saved and loaded correctly.

Hope this helps.

Regards,
Kalin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Robert
Top achievements
Rank 1
answered on 09 Oct 2014, 12:10 PM
Hi Kalin,

Finally it works fine.
Thank you very much!

Best regards,
Rob
0
Jeramy
Top achievements
Rank 1
answered on 18 Feb 2016, 11:13 PM

Hello,

I cannot seem to get this to work in my code. The FindName method always returns Null.

In the ProcessExecutionDocking_Loaded event handler:

var resizer = LeftVerticalSplitter.Template.FindName("DockResizer", LeftVerticalSplitter) as RadGridResizer;

 

Some of my XAML:

<telerikDocking:RadDocking x:Name="ProcessExecutionDocking"  AllowUnsafeMode="True" Loaded="ProcessExecutionDocking_Loaded" >...

<telerikDocking:RadSplitContainer x:Name="LeftVerticalSplitter" InitialPosition="DockedLeft" Orientation="Vertical" VerticalAlignment="Stretch">...

 

What am I missing?

0
Kalin
Telerik team
answered on 23 Feb 2016, 08:08 AM
Hello Jeramy,

I have attached a sample project demonstrating the exact approach - please check it and let me know if you have any further issues.

Regards,
Kalin
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Docking
Asked by
Robert
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Robert
Top achievements
Rank 1
Jeramy
Top achievements
Rank 1
Share this question
or