UniformGrid
Represents a layout panel that arranges child elements in a uniform grid where all cells have equal size.
Definition
Namespace:Telerik.WinControls.Layouts
Assembly:Telerik.WinControls.dll
Syntax:
public class UniformGrid : LayoutPanel, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode
Inheritance: objectDisposableObjectRadObjectRadElementLayoutPanelUniformGrid...
Implements:
Inherited Members
Constructors
public UniformGrid()
Fields
Identifies the Columns dependency property.
public static readonly RadProperty ColumnsProperty
This property determines the number of columns in the uniform grid. When set to 0, the number of columns is automatically calculated based on the number of child elements.
Identifies the FirstColumn dependency property.
public static readonly RadProperty FirstColumnProperty
This property specifies the first column where child elements should start being placed. This allows for offsetting the grid placement and creating layouts with leading empty cells.
Identifies the Rows dependency property.
public static readonly RadProperty RowsProperty
This property determines the number of rows in the uniform grid. When set to 0, the number of rows is automatically calculated based on the number of child elements.
Identifies the column index attached property for child elements.
public static readonly RadProperty UniformGridColumnIndexProperty
This attached property allows explicit positioning of child elements at specific column indices within the uniform grid, overriding the default sequential placement.
Identifies the row index attached property for child elements.
public static readonly RadProperty UniformGridRowIndexProperty
This attached property allows explicit positioning of child elements at specific row indices within the uniform grid, overriding the default sequential placement.
Properties
Gets or sets the number of columns in the uniform grid.
public int Columns { get; set; }
An integer value representing the number of columns. When set to 0 (default), the number of columns is automatically calculated based on the number of child elements.
Setting this property to a specific value forces the grid to use exactly that many columns, regardless of the number of child elements. Child elements will wrap to new rows as needed.
Gets or sets the index of the first column where child elements begin placement.
public int FirstColumn { get; set; }
An integer value representing the starting column index. The default value is 0.
This property allows you to offset the placement of child elements, creating empty cells at the beginning of the grid. Child elements will start filling cells from this column index.
Gets or sets the number of rows in the uniform grid.
public int Rows { get; set; }
An integer value representing the number of rows. When set to 0 (default), the number of rows is automatically calculated based on the number of child elements.
Setting this property to a specific value forces the grid to use exactly that many rows, regardless of the number of child elements. Child elements will wrap to new columns as needed.
Methods
Arranges the RadElement to its final location. The element must call the Arrange method of each of its children.
protected override SizeF ArrangeOverride(SizeF finalSize)
The size that is available for element.
Returns:The rectangle occupied by the element. Usually finalSize. Should you return different size, the Layout system will restart measuring and rearranging the items. That could lead to infinite recursion.
Overrides:
In this method call to the Arrange method of each child must be made.
Gets the column index for the specified element within the uniform grid.
public static int GetColumnIndex(RadElement element)
The element whose column position will be retrieved.
Returns:An integer representing the zero-based column index of the element.
This method retrieves the attached property value that specifies the element's column position within the uniform grid layout.
Gets the row index for the specified element within the uniform grid.
public static int GetRowIndex(RadElement element)
The element whose row position will be retrieved.
Returns:An integer representing the zero-based row index of the element.
This method retrieves the attached property value that specifies the element's row position within the uniform grid layout.
Measures the space required by the RadElement
Used by the layout system.
protected override SizeF MeasureOverride(SizeF availableSize)
The size that is available to the RadElement. The available size can be infinity (to take the full size of the element)
Returns:The minimum size required by the element to be completely visible. Cannot be infinity.
Overrides:
In this method call to the Measure method of each child must be made.
Sets the column index for the specified element within the uniform grid.
public static void SetColumnIndex(RadElement element, int index)
The element whose column position will be set.
indexintThe zero-based column index where the element should be placed.
This method sets an attached property that allows explicit positioning of elements at specific grid coordinates, overriding the default sequential placement behavior.
Sets the row index for the specified element within the uniform grid.
public static void SetRowIndex(RadElement element, int index)
The element whose row position will be set.
indexintThe zero-based row index where the element should be placed.
This method sets an attached property that allows explicit positioning of elements at specific grid coordinates, overriding the default sequential placement behavior.