# Grid

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/struct-grid/

**struct** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
struct Grid
```

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

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L277)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`show_grid_lines_property`](#function-show_grid_lines_property)
- [`row_spacing_property`](#function-row_spacing_property)
- [`column_spacing_property`](#function-column_spacing_property)
- [`column_property`](#function-column_property)
- [`row_property`](#function-row_property)
- [`column_span_property`](#function-column_span_property)
- [`row_span_property`](#function-row_span_property)
- [`is_shared_size_scope_property`](#function-is_shared_size_scope_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`set_column`](#function-set_column)
- [`get_column`](#function-get_column)
- [`set_row`](#function-set_row)
- [`get_row`](#function-get_row)
- [`set_column_span`](#function-set_column_span)
- [`get_column_span`](#function-get_column_span)
- [`set_row_span`](#function-set_row_span)
- [`get_row_span`](#function-get_row_span)
- [`set_is_shared_size_scope`](#function-set_is_shared_size_scope)
- [`get_is_shared_size_scope`](#function-get_is_shared_size_scope)
- [`show_grid_lines`](#function-show_grid_lines)
- [`set_show_grid_lines`](#function-set_show_grid_lines)
- [`row_spacing`](#function-row_spacing)
- [`set_row_spacing`](#function-set_row_spacing)
- [`column_spacing`](#function-column_spacing)
- [`set_column_spacing`](#function-set_column_spacing)
- [`column_definitions`](#function-column_definitions)
- [`set_column_definitions`](#function-set_column_definitions)
- [`row_definitions`](#function-row_definitions)
- [`set_row_definitions`](#function-set_row_definitions)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L292)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<Grid>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L292)

<a id="function-show_grid_lines_property"></a>

### show_grid_lines_property

```rust
fn show_grid_lines_property() -> &'static StyledProperty<bool>
```

Defines the `ShowGridLines` property. This property is used mostly
for the simplification of visual debugging. When it is set to
true, grid lines are drawn to visualize the location of the grid
lines.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L749)

<a id="function-row_spacing_property"></a>

### row_spacing_property

```rust
fn row_spacing_property() -> &'static StyledProperty<f64>
```

Defines the `RowSpacing` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L749)

<a id="function-column_spacing_property"></a>

### column_spacing_property

```rust
fn column_spacing_property() -> &'static StyledProperty<f64>
```

Defines the `ColumnSpacing` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L749)

<a id="function-column_property"></a>

### column_property

```rust
fn column_property() -> &'static AttachedProperty<i32>
```

Defines the `Column` attached property, which can be set on any
element treated as a cell. It specifies the position of the child
with respect to the columns.

Columns are 0-based: in order to appear in the first column, an
element should have the property set to 0, which is the default
value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L749)

<a id="function-row_property"></a>

### row_property

```rust
fn row_property() -> &'static AttachedProperty<i32>
```

Defines the `Row` attached property, which can be set on any
element treated as a cell. It specifies the position of the child
with respect to the rows.

Rows are 0-based: in order to appear in the first row, an element
should have the property set to 0, which is the default value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L749)

<a id="function-column_span_property"></a>

### column_span_property

```rust
fn column_span_property() -> &'static AttachedProperty<i32>
```

Defines the `ColumnSpan` attached property, which can be set on
any element treated as a cell. It specifies the width of the child
with respect to the columns: a value of 2 means that the child
spans across two columns.

The default value is 1.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L749)

<a id="function-row_span_property"></a>

### row_span_property

```rust
fn row_span_property() -> &'static AttachedProperty<i32>
```

Defines the `RowSpan` attached property, which can be set on any
element treated as a cell. It specifies the height of the child
with respect to the row grid lines: a value of 3 means that the
child spans across three rows.

The default value is 1.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L749)

<a id="function-is_shared_size_scope_property"></a>

### is_shared_size_scope_property

```rust
fn is_shared_size_scope_property() -> &'static AttachedProperty<bool>
```

Defines the `IsSharedSizeScope` attached property, which marks the
scoping element for shared sizes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L749)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L898)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L909)

<a id="function-set_column"></a>

### set_column

```rust
fn set_column(element: &Control, value: i32)
```

Sets the `Column` property on a control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L914)

<a id="function-get_column"></a>

### get_column

```rust
fn get_column(element: &Control) -> i32
```

Reads the `Column` property from a control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L919)

<a id="function-set_row"></a>

### set_row

```rust
fn set_row(element: &Control, value: i32)
```

Sets the `Row` property on a control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L924)

<a id="function-get_row"></a>

### get_row

```rust
fn get_row(element: &Control) -> i32
```

Reads the `Row` property from a control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L929)

<a id="function-set_column_span"></a>

### set_column_span

```rust
fn set_column_span(element: &Control, value: i32)
```

Sets the `ColumnSpan` property on a control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L934)

<a id="function-get_column_span"></a>

### get_column_span

```rust
fn get_column_span(element: &Control) -> i32
```

Reads the `ColumnSpan` property from a control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L939)

<a id="function-set_row_span"></a>

### set_row_span

```rust
fn set_row_span(element: &Control, value: i32)
```

Sets the `RowSpan` property on a control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L944)

<a id="function-get_row_span"></a>

### get_row_span

```rust
fn get_row_span(element: &Control) -> i32
```

Reads the `RowSpan` property from a control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L949)

<a id="function-set_is_shared_size_scope"></a>

### set_is_shared_size_scope

```rust
fn set_is_shared_size_scope(element: &Control, value: bool)
```

Sets the `IsSharedSizeScope` property on a control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L954)

<a id="function-get_is_shared_size_scope"></a>

### get_is_shared_size_scope

```rust
fn get_is_shared_size_scope(element: &Control) -> bool
```

Reads the `IsSharedSizeScope` property from a control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L959)

<a id="function-show_grid_lines"></a>

### show_grid_lines

```rust
fn show_grid_lines(self: &Self) -> bool
```

Whether the grid lines are shown.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L964)

<a id="function-set_show_grid_lines"></a>

### set_show_grid_lines

```rust
fn set_show_grid_lines(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L968)

<a id="function-row_spacing"></a>

### row_spacing

```rust
fn row_spacing(self: &Self) -> f64
```

The size of the spacing to place between grid rows.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L973)

<a id="function-set_row_spacing"></a>

### set_row_spacing

```rust
fn set_row_spacing(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L977)

<a id="function-column_spacing"></a>

### column_spacing

```rust
fn column_spacing(self: &Self) -> f64
```

The size of the spacing to place between grid columns.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L982)

<a id="function-set_column_spacing"></a>

### set_column_spacing

```rust
fn set_column_spacing(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L986)

<a id="function-column_definitions"></a>

### column_definitions

```rust
fn column_definitions(self: &Self) -> ColumnDefinitions
```

The collection of column definitions.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L991)

<a id="function-set_column_definitions"></a>

### set_column_definitions

```rust
fn set_column_definitions(self: &Self, value: ColumnDefinitions)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L1003)

<a id="function-row_definitions"></a>

### row_definitions

```rust
fn row_definitions(self: &Self) -> RowDefinitions
```

The collection of row definitions.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L1019)

<a id="function-set_row_definitions"></a>

### set_row_definitions

```rust
fn set_row_definitions(self: &Self, value: RowDefinitions)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/grid.rs#L1031)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`PanelImplExt`](/docs/0.5.0/api/ferroui-controls/trait-panelimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<Grid>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`PanelImpl`](/docs/0.5.0/api/ferroui-controls/trait-panelimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
