Class Grid
Defines a flexible grid area that consists of columns and rows.
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class Grid : Panel, IFrameworkElement, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceGrid()
Initializes a new instance of the Grid class.
Declaration
public Grid()
Fields
| Improve this Doc View SourceColumnProperty
Identifies the Grid.Column attached property.
Declaration
public static readonly DependencyProperty ColumnProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ColumnSpanProperty
Identifies the Grid.ColumnSpan attached property.
Declaration
public static readonly DependencyProperty ColumnSpanProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
RowProperty
Identifies the Grid.Row attached property.
Declaration
public static readonly DependencyProperty RowProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
RowSpanProperty
Identifies the Grid.RowSpan attached property.
Declaration
public static readonly DependencyProperty RowSpanProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ShowGridLinesProperty
Identifies the ShowGridLines dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty ShowGridLinesProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceColumnDefinitions
Gets a ColumnDefinitionCollection defined on this instance of Grid.
Declaration
public ColumnDefinitionCollection ColumnDefinitions { get; }
Property Value
Type | Description |
---|---|
ColumnDefinitionCollection | A ColumnDefinitionCollection defined on this instance of Grid. |
RowDefinitions
Gets a RowDefinitionCollection defined on this instance of Grid.
Declaration
public RowDefinitionCollection RowDefinitions { get; }
Property Value
Type | Description |
---|---|
RowDefinitionCollection | A RowDefinitionCollection defined on this instance of Grid. |
ShowGridLines
Gets or sets a value that indicates whether grid lines are visible within this Grid.
Declaration
[NotImplemented]
public bool ShowGridLines { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if grid lines are visible; otherwise, false. The default value is false. |
Methods
| Improve this Doc View SourceArrangeOverride(Size)
Arranges the content of a Grid element.
Declaration
protected override Size ArrangeOverride(Size arrangeSize)
Parameters
Type | Name | Description |
---|---|---|
Size | arrangeSize | Specifies the size this Grid element should use to arrange its child elements. |
Returns
Type | Description |
---|---|
Size | Size that represents the arranged size of this Grid element and its children. |
Overrides
| Improve this Doc View SourceGetColumn(UIElement)
Gets the value of the Grid.Column attached property from a given UIElement.
Declaration
public static int GetColumn(UIElement element)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element from which to read the property value. |
Returns
Type | Description |
---|---|
System.Int32 | The value of the Grid.Column attached property. |
GetColumnSpan(UIElement)
Gets the value of the Grid.ColumnSpan attached property from a given UIElement.
Declaration
public static int GetColumnSpan(UIElement element)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element from which to read the property value. |
Returns
Type | Description |
---|---|
System.Int32 | The value of the Grid.ColumnSpan attached property. |
GetRow(UIElement)
Gets the value of the Grid.Row attached property from a given UIElement.
Declaration
public static int GetRow(UIElement element)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element from which to read the property value. |
Returns
Type | Description |
---|---|
System.Int32 | The value of the Grid.Row attached property. |
GetRowSpan(UIElement)
Gets the value of the Grid.RowSpan attached property from a given UIElement.
Declaration
public static int GetRowSpan(UIElement element)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element from which to read the property value. |
Returns
Type | Description |
---|---|
System.Int32 | The value of the Grid.RowSpan attached property. |
MeasureOverride(Size)
Measures the children of a Grid in anticipation of arranging them during the ArrangeOverride(Size) pass.
Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
Type | Name | Description |
---|---|---|
Size | constraint | Indicates an upper limit size that should not be exceeded. |
Returns
Type | Description |
---|---|
Size | Size that represents the required size to arrange child content. |
Overrides
| Improve this Doc View SourceOnVisualChildrenChanged(DependencyObject, DependencyObject)
Called when the visual children of a Grid element change.
Declaration
protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | visualAdded | Identifies the visual child that's added. |
DependencyObject | visualRemoved | Identifies the visual child that's removed. |
Overrides
| Improve this Doc View SourceSetColumn(UIElement, Int32)
Sets the value of the Grid.Column attached property to a given UIElement.
Declaration
public static void SetColumn(UIElement element, int value)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element on which to set the Grid.Column attached property. |
System.Int32 | value | The property value to set. |
SetColumnSpan(UIElement, Int32)
Sets the value of the Grid.ColumnSpan attached property to a given UIElement.
Declaration
public static void SetColumnSpan(UIElement element, int value)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element on which to set the Grid.ColumnSpan attached property. |
System.Int32 | value | The property value to set. |
SetRow(UIElement, Int32)
Sets the value of the Grid.Row attached property to a given UIElement.
Declaration
public static void SetRow(UIElement element, int value)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element on which to set the attached property. |
System.Int32 | value | The property value to set. |
SetRowSpan(UIElement, Int32)
Sets the value of the Grid.RowSpan attached property to a given UIElement.
Declaration
public static void SetRowSpan(UIElement element, int value)
Parameters
Type | Name | Description |
---|---|---|
UIElement | element | The element on which to set the Grid.RowSpan attached property. |
System.Int32 | value | The property value to set. |