# TemplateCell

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls-treedatagrid/models/struct-templatecell/

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

```rust
struct TemplateCell
```

`TemplateCell`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/models/template_cell.rs#L18)

## Members

- [`new`](#function-new)
- [`get_cell_template`](#function-get_cell_template)
- [`get_cell_editing_template`](#function-get_cell_editing_template)
- [`value`](#function-value)
- [`set_value`](#function-set_value)

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

### new

```rust
fn new(value: Option<BoxedValue>, get_cell_template: CellTemplateGetter, get_cell_editing_template: Option<CellTemplateGetter>, options: Option<Rc<dyn ITemplateCellOptions>>) -> Rc<Self>
```

A cell of `value` shown with the template `get_cell_template` returns and edited with the
one `get_cell_editing_template` returns.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/models/template_cell.rs#L28)

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

### get_cell_template

```rust
fn get_cell_template(self: &Self) -> &CellTemplateGetter
```

The template of the cell when it is not editing.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/models/template_cell.rs#L38)

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

### get_cell_editing_template

```rust
fn get_cell_editing_template(self: &Self) -> Option<&CellTemplateGetter>
```

The template of the cell when it is editing, if the cell can be edited.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/models/template_cell.rs#L43)

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

### value

```rust
fn value(self: &Self) -> Option<BoxedValue>
```

The value of the cell.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/models/template_cell.rs#L48)

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

### set_value

```rust
fn set_value(self: &Self, value: Option<BoxedValue>)
```

Points the cell at another value (a reused cell of another row).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/models/template_cell.rs#L53)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`ICell`](/docs/0.5.0/api/ferroui-controls-treedatagrid/models/trait-icell/)
- [`IEditableObject`](/docs/0.5.0/api/ferroui-controls-treedatagrid/models/trait-ieditableobject/)

## Availability

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