ClassUniformWrapLayoutPanel
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
UniformWrapLayoutPanel()
Declaration
public UniformWrapLayoutPanel()
Properties
MaxColumnsCount
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).
MinItemWidth
Gets or sets the minimum desired width per item used to calculate column count.
Methods
ArrangeOverride(SizeF)
Positions and sizes all child elements within the final layout area, implementing the wrapping and alignment behavior based on the current panel configuration.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
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
Remarks
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.
MeasureOverride(SizeF)
Measures the size required to accommodate all child elements within the specified constraints, accounting for wrapping behavior and uniform sizing settings.
Declaration
protected override SizeF MeasureOverride(SizeF constraint)
Parameters
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
Remarks
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.