Search code examples
c#.netwinformsteleriksplitpanel

Telerik RadSplitContainer SizeInfo RelativeRatio


According to the Telerik docs, the relative size of the panels in a RadSplitContainer are set with the RelativeRatio property. I can't figure out how to use this property.

I would like a left panel and a right panel, the left panel 50% of the width of the right panel.

http://www.telerik.com/help/winforms/splitcontainer-overview.html


Solution

  • It's quite easy:

    • Set both panels inside the splitcontainer to relative

    • Then set the RelativeRatio of the right panel = 0.66, 0 and the RelativeRatio of the left panel = 0.33,0:

    Example:

    enter image description here

    EDIT :

    enter image description here

    EDIT 2:

            splitPanel1.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Relative;
            splitPanel2.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Relative;
    
            splitPanel1.SizeInfo.RelativeRatio = new SizeF(0.33f, 0f);
            splitPanel2.SizeInfo.RelativeRatio = new SizeF(0.66f, 0f);