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

Programmatically setting size

5 Answers 955 Views
SplitContainer
This is a migrated thread and some comments may be shown as answers.
lkeel
Top achievements
Rank 1
lkeel asked on 01 Aug 2009, 03:10 AM
I guess I am the only person who can't figure this out, but how do I programmatically set the size of a panel in the splitcontainer?  I have a form that has 2 panels and I want to be able to resize the containers on startup based on size during last use.  I have tried:
  • Setting Panel Heights
  • Setting radSplitContainer1.SplitPanels[?].Height
  • Setting radSplitContainer1.Splitters[0].Location

I am out of ideas.  Please let me know if this is possible.

Thanks,
Lee

5 Answers, 1 is accepted

Sort by
0
Accepted
Boryana
Telerik team
answered on 04 Aug 2009, 12:03 PM
Hello Lee,

Thank you for contacting us. In order to set size of the RadPanel contained in a RadSplitContainer you can use the following snippet:

this.radSplitContainer1.SplitPanels["splitPanel1"].SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Absolute; 
this.radSplitContainer1.SplitPanels["splitPanel1"].SizeInfo.AbsoluteSize = new Size(150, 0); 

You can find more information on the topic in our online documentation. It might be also helpful for you to see the code of the RadSpitContainer examples in our demos. The easiest way to resize the split panels on start up depending on the previous use is to save the AbsoluteSize property in a file and then on start up to assign the property the value contained in the file.

I hope this is helpful. However, if you encounter any further difficulties, please, contact me back.

Regards,
Boryana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
lkeel
Top achievements
Rank 1
answered on 04 Aug 2009, 03:18 PM
Thank you for your response.  This did solve my problem.
0
Frank
Top achievements
Rank 1
answered on 13 Oct 2011, 07:35 PM
Thanks - I found this useful also.
0
Bill
Top achievements
Rank 1
answered on 16 Feb 2018, 02:21 PM
One thing to be careful of are different DPI and resolution settings. I was setting my panels absolute size like above, and when a user had different display settings as I, the panels didn't display properly. In fact, I didn't like how the split panels worked at all when I had the absolute size mode set under different DPI configurations. As an alternative, I set the size mode to relative, set the relative size of the panels, and then just saved the relative ratio to file which I read on restart. This worked across different display configurations nicely.
0
Hristo
Telerik team
answered on 19 Feb 2018, 02:44 PM
Hi Bill,

Thank you for sharing your solution. Indeed in environment controls set with a static location or absolute size may not scale properly. In the R2 2017 release, we introduced support for built-in in the framework to handle higher DPI scaling: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/dpi-support. You can also check our new ERP demo application which is designed to handle HDPI and larger themes automatically: https://www.telerik.com/blogs/new-erp-demo-app-available-telerik-ui-for-winforms.

Let me know if you have other questions.

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.
Tags
SplitContainer
Asked by
lkeel
Top achievements
Rank 1
Answers by
Boryana
Telerik team
lkeel
Top achievements
Rank 1
Frank
Top achievements
Rank 1
Bill
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or