Share via


GridExtensions.Add Method

Definition

Overloads

Add(Grid, IView, Int32, Int32)

Adds an IView to the Grid at the specified column and row with a row span of 1 and a column span of 1.

Add(Grid, IView, Int32, Int32, Int32, Int32)
Obsolete.

Adds an IView to the Grid at the specified row and column spans.

Add(Grid, IView, Int32, Int32)

Source:
GridExtensions.cs
Source:
GridExtensions.cs

Adds an IView to the Grid at the specified column and row with a row span of 1 and a column span of 1.

public static void Add (this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int column = 0, int row = 0);
static member Add : Microsoft.Maui.Controls.Grid * Microsoft.Maui.IView * int * int -> unit
<Extension()>
Public Sub Add (grid As Grid, view As IView, Optional column As Integer = 0, Optional row As Integer = 0)

Parameters

grid
Grid

The Grid to which the IView will be added.

view
IView

The IView to add.

column
Int32

The column in which to place the IView.

row
Int32

The row in which to place the IView.

Exceptions

Thrown when view is null.

Thrown when row or column are less than 0.

Remarks

If the Grid does not have enough rows/columns to encompass the specified location, they will be added.

Applies to

Add(Grid, IView, Int32, Int32, Int32, Int32)

Source:
GridExtensions.cs
Source:
GridExtensions.cs

Caution

This method is obsolete. Please use AddWithSpan(this Grid, IView, int, int, int, int) instead.

Adds an IView to the Grid at the specified row and column spans.

public:
[System::Runtime::CompilerServices::Extension]
 static void Add(Microsoft::Maui::Controls::Grid ^ grid, Microsoft::Maui::IView ^ view, int left, int right, int top, int bottom);
[System.Obsolete("This method is obsolete. Please use AddWithSpan(this Grid, IView, int, int, int, int) instead.")]
public static void Add (this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int left, int right, int top, int bottom);
[<System.Obsolete("This method is obsolete. Please use AddWithSpan(this Grid, IView, int, int, int, int) instead.")>]
static member Add : Microsoft.Maui.Controls.Grid * Microsoft.Maui.IView * int * int * int * int -> unit
<Extension()>
Public Sub Add (grid As Grid, view As IView, left As Integer, right As Integer, top As Integer, bottom As Integer)

Parameters

grid
Grid

The Grid to which the IView will be added.

view
IView

The IView to add.

left
Int32

The left edge of the column span. Must be greater than or equal to 0.

right
Int32

The right edge of the column span. Must be greater than left. The IView won't occupy this column, but will stop just before it.

top
Int32

The top edge of the row span. Must be greater than or equal to 0.

bottom
Int32

The bottom edge of the row span. Must be greater than top. The IView won't occupy this row, but will stop just before it.

Attributes

Exceptions

Thrown when view is null.

Thrown when left or top are less than 0, bottom is less than or equal to top, or right is less than or equal to left.

Remarks

If the Grid does not have enough rows/columns to encompass the specified spans, they will be added.

Applies to