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

Panels that don't resize

14 Answers 690 Views
SplitContainer
This is a migrated thread and some comments may be shown as answers.
James Relyea
Top achievements
Rank 1
James Relyea asked on 11 Dec 2009, 03:06 PM
I have a docked RADSplitContainer with 3 panels, 2 horizontal splitters. I only want the middle panel to resize when the form is resized the top & bottom are can not be resized. Will an absolute size take care of that, or do I need to do something else (and what would that be?)?

Thanks

:)
jr

14 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 11 Dec 2009, 04:22 PM
Hello James Relyea,

In order to achieve your requirement, it is enough to set the SizeMode to Absolute:

this.splitPanel1.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Absolute;

You can review an example of such behavior in our Examples application, section SplitContainer >> FirstLook.

I hope this helps. If you have additional questions, feel free to contact me.

All the best,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
James Relyea
Top achievements
Rank 1
answered on 11 Dec 2009, 05:59 PM
Setting absolute sizes only prevents the panels from resizing as the form resizes. How do I lock the panel from resizing at all? I don't want users to move the splitter bar either and leave the splitter bar visible.

Thanks
:)
jr
0
Nikolay
Telerik team
answered on 14 Dec 2009, 12:26 PM
Hi James Relyea,

In order to prevent a panel from resizing, you should fix the splitters that are responsible for the resizing operation. This is demonstrated in the Split Container >> First Look sample as well. Basically, you need to set Fixed property of the desired SplitterElement to true:

this.radSplitContainer1.Splitters[0].Fixed = true;

All the best,

Nikolay
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
James Relyea
Top achievements
Rank 1
answered on 14 Dec 2009, 12:57 PM
Is that a code only property, or is there a design time property for it too?

Thanks for the reply.

:)
jr
0
Nikolay
Telerik team
answered on 14 Dec 2009, 03:52 PM
Hello James Relyea,

Currently, Splitters cannot be accessed at design-time. We will improve this behavior in one of our next releases. For the time being, please set the Fixed property in code.

Sincerely yours,

Nikolay
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
KKL
Top achievements
Rank 1
answered on 22 Jun 2017, 10:32 AM
Apologies for dredging up an ancient post, but my question really flows on naturally from this. Once a splitter panel is fixed, is there an easy way to remove the size grip graphic and the mouse cursor hover change? 
0
Hristo
Telerik team
answered on 26 Jun 2017, 02:42 PM
Hello,

Yes, that could be accomplished pretty much easily. The observed behavior is actually an issue and it is logged here: https://feedback.telerik.com/Project/154/Feedback/Details/219855-fix-radsplitcontainer-the-layout-element-holding-the-resizing-grip-and-splitte.

You can refer to the feedback item for the suggested workaround. The issue is already in development and it will be included in our R3 2017 release. I have updated your Telerik points for the report.

I hope this helps. Please let me know if you need further assistance.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
KKL
Top achievements
Rank 1
answered on 27 Jun 2017, 09:57 AM

Thanks for that. I can't access that link though. 'The page you're looking for isn't here.'

If the page is protected, can the workaround be posted here? 

0
Hristo
Telerik team
answered on 27 Jun 2017, 10:26 AM
Hi,

Indeed there was an issue with the link and the feedback portal, now it should work and you can check the item here.

Just in case, I am also posting the workaround: 
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
 
        new RadControlSpyForm().Show();
 
        this.radSplitContainer1.EnableCollapsing = true;
        this.radSplitContainer1.UseSplitterButtons = true;
    }
 
    protected override void OnShown(EventArgs e)
    {
        base.OnShown(e);
 
        foreach (SplitterElement splitter in this.radSplitContainer1.Splitters)
        {
            splitter.Fixed = true;
            splitter.Layout.Visibility = ElementVisibility.Collapsed;
        }
    }
 
    private void button1_Click(object sender, EventArgs e)
    {
        foreach (SplitterElement splitter in this.radSplitContainer1.Splitters)
        {
            splitter.Fixed = !splitter.Fixed;
            splitter.Layout.Visibility = !splitter.Fixed ? ElementVisibility.Visible : ElementVisibility.Collapsed;
        }
    }
}
 
public class MyRadSplitContainer : RadSplitContainer
{
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadSplitContainer).FullName;
        }
    }
 
    public override Cursor Cursor
    {
        get
        {
            return base.Cursor;
        }
        set
        {
            SplitterElement splitter = this.GetSplitterElementAtPoint(this.PointToClient(Cursor.Position));
            if (!(splitter != null && splitter.Fixed))
            {
                base.Cursor = value;
            }
        }
    }
}

I hope this helps. Please let me know if you need further assistance.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
KKL
Top achievements
Rank 1
answered on 27 Jun 2017, 10:34 AM
Thank you for your fast reply!
0
John
Top achievements
Rank 1
answered on 08 May 2018, 02:39 PM

Hi,  I'm trying to fix the width of a panel and also enable collapse and restore functionality. I can get one or the other but not both.  This is what i tried:

        Me.SplitPanel1.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Absolute
        Me.SplitPanel1.SizeInfo.AbsoluteSize = New Size(237, 0)
        RadSplitContainer1.Splitters(0).Fixed = True
        RadSplitContainer1.Splitters(0).Layout.Visibility = ElementVisibility.Collapsed

but not seeing the collapse button.

Thanks,

John

 

0
Hristo
Telerik team
answered on 09 May 2018, 02:00 PM
Hello John,

The Fixed property forces the buttons to collapse. If you want to use them you will need to set up the control similarly to my code snippet below: 
this.radSplitContainer1.EnableCollapsing = true;
this.radSplitContainer1.UseSplitterButtons = true;
this.radSplitContainer1.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Absolute;
this.radSplitContainer1.SizeInfo.AbsoluteSize = new Size(237, 0);

Additional information is also available here: https://docs.telerik.com/devtools/winforms/splitcontainer/splitter-buttons.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Mark
Top achievements
Rank 2
Veteran
answered on 04 Sep 2018, 07:35 PM
After reading the first few post of this thread. Why didn't you just use 3 RadPanels inside a RadPanel   You can dock/anchor he main panel to the form. the Panels inside, one would be docked top the other docked bottom and the last docked full. This would accomplish everything you want w/out a splitter leaving the TOP and BOTTOM panels a static size and allowing the middle panel resize when the form resizes.  No need to worry about a Split Container and it's panels and the sizer bar.   One thing you will have to do with your Panels in your main panel, is make sure they are loaded (BRING TO FRONT) in the correct order, so that the middle panel doesn't overlap the top or bottom panel, but that's easy to do.
0
Hristo
Telerik team
answered on 05 Sep 2018, 10:29 AM
Hi Mark,

Thank you for sharing your thoughts in this thread. Indeed a similar result could be achieved following the approach you suggested. I am sure that this will of help to the community.

Regards,
Hristo
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
SplitContainer
Asked by
James Relyea
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
James Relyea
Top achievements
Rank 1
KKL
Top achievements
Rank 1
Hristo
Telerik team
John
Top achievements
Rank 1
Mark
Top achievements
Rank 2
Veteran
Share this question
or