New to Telerik UI for WinForms? Download free 30-day trial

WrapLayoutPanel

WrapLayoutPanel is a panel that handles the layout of elements in a vertical or horizontal row and wraps to additional lines.

tpf-layout-predefined-layout-panels-wraplayoutpanel 001

Using WrapLayoutPanel

public class MyWrapLayoutPanelElement : RadElement
{
    protected override void CreateChildElements()
    {
        WrapLayoutPanel layoutPanel = new WrapLayoutPanel();
        layoutPanel.Orientation = Orientation.Horizontal;
        for (int i = 0; i < 10; i++)
        {
            layoutPanel.Children.Add(GetTextBoxElement(i));
        }
        this.Children.Add(layoutPanel);
        base.CreateChildElements();
    }
    private RadTextBoxElement GetTextBoxElement(int count)
    {
        RadTextBoxElement result = new RadTextBoxElement();
     //   result.ShowBorder = true;
        result.Text = "Element" + count.ToString();
        result.Class = "MyTextBoxElement";
        result.StretchHorizontally = false;
        result.StretchVertically = false;
        result.MinSize = new Size(100, 17);
        return result;
    }
}