Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > SplitContainer > SplitPanel AutoSize

Answered SplitPanel AutoSize

Feed from this thread
  • Mirek avatar

    Posted on Jan 7, 2012 (permalink)

    Hi,
    I am using version Q3 2011.

    1. I have a RadPageViewPage object in which I placed a RadSplitContainer (DockStyle.Fill) with two SplitPanels.
    2. Each SplitPanel has Padding property set.
    3. In the first SplitPanel I add a control and set its Dock property to Fill the entire content of the panel.
    4. In the second SplitPanel instance I add number of controls with their Dock properties set to Top, but the entire SplitPanel's default size is way bigger than the sum of the controls embedded within.
    5. I am not using designer, the controls are added programmatically.

    Question is: How do I AutoSize both SplitPanel so that the second fits the size of child controls (with set Dock properties to DockStyle.Top) and the first one fill all space that is left?

    Best regards,
    Mirek

    Reply

  • Answer Ivan Todorov Ivan Todorov admin's avatar

    Posted on Jan 11, 2012 (permalink)

    Hi Mirek,

    Thank you for your question.

    The AutoSize property comes from the base Control class, but is not relevant for all controls. RadSplitContainer is one of the controls that does not support AutoSize. Furthermore, when you set the Dock property of RadSplitContainer to Fill, it always occupies the entire client area of its parent (the RadPageViewPage) and therefore cannot be sized. On the other hand, the SplitPanels are arranged internally by the RadSplitContainer and also cannot be sized.

    To achieve the desired scenario, you can implement the automatic sizing by handling some events. This is demonstrated in the attached files.

    I hope this will help you. Do not hesitate to ask if you have any additional questions.

    Regards,
    Ivan Todorov
    the Telerik team

    SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

    Attached files

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > SplitContainer > SplitPanel AutoSize
Related resources for "SplitPanel AutoSize"

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