A WrapLayoutPanel that automatically distributes children into equal-width columns based on the available width and a minimum item width.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class UniformWrapLayoutPanel : WrapLayoutPanel, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode
Inheritance: objectDisposableObjectRadObjectRadElementLayoutPanelWrapLayoutPanelUniformWrapLayoutPanel...
Implements:
Inherited Members
Constructors
public UniformWrapLayoutPanel()
Properties
Gets or sets the maximum number of columns. When the available width allows more columns than this value, items stretch horizontally to fill the space instead. The default value is MaxValue (no limit).
public int MaxColumnsCount { get; set; }
Gets or sets the minimum desired width per item used to calculate column count.
public float MinItemWidth { get; set; }
Methods
Positions and sizes all child elements within the final layout area, implementing the wrapping and alignment behavior based on the current panel configuration.
protected override SizeF ArrangeOverride(SizeF finalSize)
The final area within the parent that the panel should use to arrange itself and its children.
Returns:The actual size used by the panel, which is typically the same as finalSize.
Overrides:
This method performs the final layout arrangement by:
- Determining line breaks based on available space and element sizes
- Applying uniform sizing constraints from ItemWidth and ItemHeight
- Positioning elements within each line according to the current Orientation
- Implementing StretchItems behavior when enabled
- Handling right-to-left layout adjustments for proper content flow
The arrangement process ensures that elements are optimally distributed within each wrapped line while maintaining visual consistency and respecting the panel's sizing and alignment settings.
Measures the size required to accommodate all child elements within the specified constraints, accounting for wrapping behavior and uniform sizing settings.
protected override SizeF MeasureOverride(SizeF constraint)
The maximum available size that the panel can use.
Returns:A SizeF representing the minimum size needed to display all child elements with proper wrapping and spacing.
Overrides:
This method implements the core measurement logic for the wrap layout:
- Measures each child element using available space constraints
- Simulates the wrapping behavior to determine line breaks
- Calculates total space requirements including wrapped lines
- Applies uniform sizing constraints from ItemWidth and ItemHeight
The measurement process respects the current Orientation setting and adjusts calculations accordingly. Elements that exceed the constraint in the primary direction cause line wrapping, while the secondary direction accumulates the total space needed.