# TreeDataGridCellsPresenter

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

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

```rust
struct TreeDataGridCellsPresenter
```

Presents the cells of a `TreeDataGridRow`, realizing only the cells
of the columns in the viewport.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L34)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`measure_element`](#function-measure_element)
- [`element_factory_property`](#function-element_factory_property)
- [`items_property`](#function-items_property)
- [`rows_property`](#function-rows_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`presenter_base`](#function-presenter_base)
- [`element_factory`](#function-element_factory)
- [`set_element_factory`](#function-set_element_factory)
- [`items`](#function-items)
- [`set_items`](#function-set_items)
- [`rows`](#function-rows)
- [`set_rows`](#function-set_rows)
- [`row_index`](#function-row_index)
- [`realized_elements`](#function-realized_elements)
- [`is_layout_in_progress`](#function-is_layout_in_progress)
- [`bring_into_view`](#function-bring_into_view)
- [`get_realized_elements`](#function-get_realized_elements)
- [`try_get_element`](#function-try_get_element)
- [`recycle_all_elements`](#function-recycle_all_elements)
- [`child_index_changed`](#function-child_index_changed)
- [`realize`](#function-realize)
- [`unrealize`](#function-unrealize)
- [`update_row_index`](#function-update_row_index)
- [`update_selection`](#function-update_selection)
- [`unrealize_on_row_removed`](#function-unrealize_on_row_removed)
- [`finalize_unrealize`](#function-finalize_unrealize)
- [`get_child_index`](#function-get_child_index)
- [`try_get_total_count`](#function-try_get_total_count)

<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/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L50)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L50)

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

### measure_element

```rust
fn measure_element(self: &Self, index: i32, element: &Ref<Control>, available_size: Size) -> Size
```

Measures the cell of the column at `index` (`MeasureElement`): the measure of the
columnar presenters, which reports the size to the columns.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L50)

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

### element_factory_property

```rust
fn element_factory_property() -> &'static DirectProperty<TreeDataGridCellsPresenter, Option<Rc<TreeDataGridElementFactory>>>
```

Defines the `ElementFactory` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L60)

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

### items_property

```rust
fn items_property() -> &'static DirectProperty<TreeDataGridCellsPresenter, Option<Rc<dyn IColumns>>>
```

Defines the `Items` property: the columns.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L60)

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

### rows_property

```rust
fn rows_property() -> &'static DirectProperty<TreeDataGridCellsPresenter, Option<Rc<dyn ITreeDataGridRows>>>
```

Defines the `Rows` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L60)

<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/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L358)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L373)

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

### presenter_base

```rust
fn presenter_base(self: &Self) -> &TreeDataGridPresenterBase
```

The state of the presenter base.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L378)

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

### element_factory

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

The factory of the cells.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L383)

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

### set_element_factory

```rust
fn set_element_factory(self: &Self, value: Option<Rc<TreeDataGridElementFactory>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L387)

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

### items

```rust
fn items(self: &Self) -> Option<Rc<dyn IColumns>>
```

The columns whose cells the presenter shows.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L392)

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

### set_items

```rust
fn set_items(self: &Self, value: Option<Rc<dyn IColumns>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L396)

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

### rows

```rust
fn rows(self: &Self) -> Option<Rc<dyn ITreeDataGridRows>>
```

The rows that realize the cell models.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L416)

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

### set_rows

```rust
fn set_rows(self: &Self, value: Option<Rc<dyn ITreeDataGridRows>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L420)

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

### row_index

```rust
fn row_index(self: &Self) -> i32
```

The index of the row the presenter shows the cells of, or -1 when it is not realized.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L434)

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

### realized_elements

```rust
fn realized_elements(self: &Self) -> Vec<Option<Ref<Control>>>
```

The realized cells, with an empty slot for each column of the realized range that has no
cell yet (`RealizedElements`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L440)

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

### is_layout_in_progress

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

Whether the presenter is in its measure or arrange pass.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L445)

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

### bring_into_view

```rust
fn bring_into_view(self: &Self, index: i32, rect: Option<Rect>) -> Option<Ref<Control>>
```

Brings the cell of the column at `index` into view (`BringIntoView`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L450)

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

### get_realized_elements

```rust
fn get_realized_elements(self: &Self) -> Vec<Ref<Control>>
```

The realized cells (`GetRealizedElements`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L455)

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

### try_get_element

```rust
fn try_get_element(self: &Self, index: i32) -> Option<Ref<Control>>
```

The realized cell of the column at `index`, if any (`TryGetElement`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L460)

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

### recycle_all_elements

```rust
fn recycle_all_elements(self: &Self)
```

Recycles all the realized cells (`RecycleAllElements`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L465)

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

### child_index_changed

```rust
fn child_index_changed(self: &Self, handler: impl Fn(&ChildIndexChangedEventArgs) -> () + 'static) -> Rc<dyn IDisposable>
```

Occurs when the index of a realized cell changes (`ChildIndexChanged`). Disposing the
returned handle unsubscribes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L471)

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

### realize

```rust
fn realize(self: &Self, index: i32)
```

Realizes the presenter for the row at `index`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L482)

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

### unrealize

```rust
fn unrealize(self: &Self)
```

Unrealizes the presenter.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L498)

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

### update_row_index

```rust
fn update_row_index(self: &Self, index: i32)
```

The index of the row changed (`UpdateRowIndex`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L511)

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

### update_selection

```rust
fn update_selection(self: &Self, selection: Option<&dyn ITreeDataGridSelectionInteraction>)
```

Updates the selection state of the realized cells (`UpdateSelection`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L532)

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

### unrealize_on_row_removed

```rust
fn unrealize_on_row_removed(self: &Self)
```

Unrealizes the presenter because its row was removed (`UnrealizeOnRowRemoved`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L543)

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

### finalize_unrealize

```rust
fn finalize_unrealize(self: &Self)
```

Recycles the cells kept for a rebind of the row when the row was not rebound
(`FinalizeUnrealize`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L554)

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

### get_child_index

```rust
fn get_child_index(self: &Self, child: &StyledElement) -> i32
```

The index of a cell (`IChildIndexProvider.GetChildIndex`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L559)

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

### try_get_total_count

```rust
fn try_get_total_count(self: &Self) -> Option<i32>
```

The number of columns (`IChildIndexProvider.TryGetTotalCount`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/primitives/tree_data_grid_cells_presenter.rs#L567)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TreeDataGridCellsPresenterImplExt`](/docs/0.5.0/api/ferroui-controls-treedatagrid/primitives/trait-treedatagridcellspresenterimplext/)
- `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`
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<TreeDataGridCellsPresenter>`](/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/)
- [`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/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`TreeDataGridCellsPresenterImpl`](/docs/0.5.0/api/ferroui-controls-treedatagrid/primitives/trait-treedatagridcellspresenterimpl/)
- [`IFinalMeasureSelector`](/docs/0.5.0/api/ferroui-controls-treedatagrid/primitives/trait-ifinalmeasureselector/)
- [`TreeDataGridPresenterHooks`](/docs/0.5.0/api/ferroui-controls-treedatagrid/primitives/trait-treedatagridpresenterhooks/)

## Availability

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