Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > SplitContainer > Programmatically setting size

Answered Programmatically setting size

Feed from this thread
  • lkeel Intermediate avatar

    Posted on Jul 31, 2009 (permalink)

    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

    Reply

  • Answer Boryana Boryana admin's avatar

    Posted on Aug 4, 2009 (permalink)

    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.

    Reply

  • lkeel Intermediate avatar

    Posted on Aug 4, 2009 (permalink)

    Thank you for your response.  This did solve my problem.

    Reply

  • Frank avatar

    Posted on Oct 13, 2011 (permalink)

    Thanks - I found this useful also.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > SplitContainer > Programmatically setting size
Related resources for "Programmatically setting size"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]