Show / Hide Table of Contents

Class Grid

Defines a flexible grid area that consists of columns and rows.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Panel
Grid
DataGridFrozenGrid
Inherited Members
Panel.LogicalChildren
Panel.VisualChildrenCount
Panel.GetVisualChild(Int32)
Panel.LogicalOrientation
Panel.HasLogicalOrientation
Panel.CreateUIElementCollection(FrameworkElement)
Panel.ProgressiveRenderingChunkSize
Panel.BackgroundProperty
Panel.Background
Panel.Children
Panel.INTERNAL_OnAttachedToVisualTree()
Panel.GetTemplateChild(String)
Panel.IsItemsHostProperty
Panel.IsItemsHost
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.CreateDomElement(Object, Object)
FrameworkElement.OnApplyTemplate()
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.ManageIsEnabled(Boolean)
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.OnCreateAutomationPeer()
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.OnKeyDown(KeyEventArgs)
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.OnGotFocus(RoutedEventArgs)
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.OnLostFocus(RoutedEventArgs)
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class Grid : Panel, IFrameworkElement, IUIElement, IDependencyObject

Constructors

| Improve this Doc View Source

Grid()

Initializes a new instance of the Grid class.

Declaration
public Grid()

Fields

| Improve this Doc View Source

ColumnProperty

Identifies the Grid.Column attached property.

Declaration
public static readonly DependencyProperty ColumnProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ColumnSpanProperty

Identifies the Grid.ColumnSpan attached property.

Declaration
public static readonly DependencyProperty ColumnSpanProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

RowProperty

Identifies the Grid.Row attached property.

Declaration
public static readonly DependencyProperty RowProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

RowSpanProperty

Identifies the Grid.RowSpan attached property.

Declaration
public static readonly DependencyProperty RowSpanProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ShowGridLinesProperty

Identifies the ShowGridLines dependency property.

Declaration
[NotImplemented]
public static readonly DependencyProperty ShowGridLinesProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

ColumnDefinitions

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 Source

ArrangeOverride(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
FrameworkElement.ArrangeOverride(Size)
| Improve this Doc View Source

GetColumn(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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
FrameworkElement.MeasureOverride(Size)
| Improve this Doc View Source

OnVisualChildrenChanged(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
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
| Improve this Doc View Source

SetColumn(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source