# TextCell

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

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

```rust
struct TextCell<T: Clone + PartialEq + 'static>
```

`TextCell<T>`: a cell whose value of type `T` is shown and edited as text.

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

## Members

- [`from_value`](#function-from_value)
- [`new`](#function-new)
- [`is_read_only`](#function-is_read_only)
- [`value`](#function-value)
- [`set_value`](#function-set_value)
- [`text`](#function-text)
- [`set_text`](#function-set_text)
- [`try_set_source`](#function-try_set_source)
- [`this`](#function-this)

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

### from_value

```rust
fn from_value(value: Option<T>) -> Rc<Self>
```

A read-only cell of a constant value (`TextCell(T? value)`).

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

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

### new

```rust
fn new(binding: Rc<dyn ICellBinding<T>>, is_read_only: bool, options: Option<Rc<dyn ITextCellCultureOptions>>) -> Rc<Self>
```

A cell of the value `binding` pushes; a cell that is not read only writes its changes back
to the binding.

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

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

### is_read_only

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

Whether the cell's value can be changed.

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

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

### value

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

The value of the cell.

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

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

### set_value

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

Sets the value; a cell that is not read only and not editing writes it to its binding.

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

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

### text

```rust
fn text(self: &Self) -> Option<String>
```

The text of the cell: the text being edited, or the value formatted with the string format
of the options, or the value's text.

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

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

### set_text

```rust
fn set_text(self: &Self, value: Option<String>)
```

Sets the text: while editing, the text being edited; otherwise the value converted from
the text (a text that does not convert is ignored).

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

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

### try_set_source

```rust
fn try_set_source(self: &Self, source: Option<&BoxedValue>) -> bool
```

Points the cell's binding at another model (`TrySetSource`); false when the binding
cannot be retargeted.

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

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

### this

```rust
fn this(self: &Self) -> Option<Rc<Self>>
```

The cell as a shared cell.

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

## 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`
- [`IEditableObject`](/docs/0.5.0/api/ferroui-controls-treedatagrid/models/trait-ieditableobject/)
- [`INotifyPropertyChanged`](/docs/0.5.0/api/ferroui-base/data/model/use-inotifypropertychanged/)
- [`ICell`](/docs/0.5.0/api/ferroui-controls-treedatagrid/models/trait-icell/)
- [`ITextCell`](/docs/0.5.0/api/ferroui-controls-treedatagrid/models/trait-itextcell/)
- [`IRecyclableCell`](/docs/0.5.0/api/ferroui-controls-treedatagrid/models/trait-irecyclablecell/)

## Availability

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