ClassUniformGrid
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
UniformGrid()
Declaration
public UniformGrid()
Fields
ColumnsProperty
Identifies the Columns dependency property.
Declaration
public static readonly RadProperty ColumnsProperty
Field Value
Remarks
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.
FirstColumnProperty
Identifies the FirstColumn dependency property.
Declaration
public static readonly RadProperty FirstColumnProperty
Field Value
Remarks
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.
RowsProperty
Identifies the Rows dependency property.
Declaration
public static readonly RadProperty RowsProperty
Field Value
Remarks
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.
UniformGridColumnIndexProperty
Identifies the column index attached property for child elements.
Declaration
public static readonly RadProperty UniformGridColumnIndexProperty
Field Value
Remarks
This attached property allows explicit positioning of child elements at specific column indices within the uniform grid, overriding the default sequential placement.
UniformGridRowIndexProperty
Identifies the row index attached property for child elements.
Declaration
public static readonly RadProperty UniformGridRowIndexProperty
Field Value
Remarks
This attached property allows explicit positioning of child elements at specific row indices within the uniform grid, overriding the default sequential placement.
Properties
Columns
Gets or sets the number of columns in the uniform grid.
Declaration
public int Columns { get; set; }
Property Value
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.
Remarks
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.
FirstColumn
Gets or sets the index of the first column where child elements begin placement.
Declaration
public int FirstColumn { get; set; }
Property Value
An integer value representing the starting column index. The default value is 0.
Remarks
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.
Rows
Gets or sets the number of rows in the uniform grid.
Declaration
public int Rows { get; set; }
Property Value
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.
Remarks
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
ArrangeOverride(SizeF)
Arranges the RadElement to its final location. The element must call the Arrange method of each of its children.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
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
Remarks
In this method call to the Arrange method of each child must be made.
GetColumnIndex(RadElement)
Gets the column index for the specified element within the uniform grid.
Declaration
public static int GetColumnIndex(RadElement element)
Parameters
element
The element whose column position will be retrieved.
Returns
An integer representing the zero-based column index of the element.
Remarks
This method retrieves the attached property value that specifies the element's column position within the uniform grid layout.
GetRowIndex(RadElement)
Gets the row index for the specified element within the uniform grid.
Declaration
public static int GetRowIndex(RadElement element)
Parameters
element
The element whose row position will be retrieved.
Returns
An integer representing the zero-based row index of the element.
Remarks
This method retrieves the attached property value that specifies the element's row position within the uniform grid layout.
MeasureOverride(SizeF)
Measures the space required by the RadElement
Used by the layout system.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
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
Remarks
In this method call to the Measure method of each child must be made.
SetColumnIndex(RadElement, int)
Sets the column index for the specified element within the uniform grid.
Declaration
public static void SetColumnIndex(RadElement element, int index)
Parameters
element
The element whose column position will be set.
index
The zero-based column index where the element should be placed.
Remarks
This method sets an attached property that allows explicit positioning of elements at specific grid coordinates, overriding the default sequential placement behavior.
SetRowIndex(RadElement, int)
Sets the row index for the specified element within the uniform grid.
Declaration
public static void SetRowIndex(RadElement element, int index)
Parameters
element
The element whose row position will be set.
index
The zero-based row index where the element should be placed.
Remarks
This method sets an attached property that allows explicit positioning of elements at specific grid coordinates, overriding the default sequential placement behavior.