# TreeDataGridRowsPresenter

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

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

```rust
struct TreeDataGridRowsPresenter
```

Presents the rows of a `TreeDataGrid`, realizing only the rows in (and
around, see `cache_length`) the viewport.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`cache_length_property`](#function-cache_length_property)
- [`columns_property`](#function-columns_property)
- [`element_factory_property`](#function-element_factory_property)
- [`items_property`](#function-items_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`presenter_base`](#function-presenter_base)
- [`columns`](#function-columns)
- [`set_columns`](#function-set_columns)
- [`cache_length`](#function-cache_length)
- [`set_cache_length`](#function-set_cache_length)
- [`element_factory`](#function-element_factory)
- [`set_element_factory`](#function-set_element_factory)
- [`items`](#function-items)
- [`set_items`](#function-set_items)
- [`realized_elements`](#function-realized_elements)
- [`viewport`](#function-viewport)
- [`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)
- [`update_selection`](#function-update_selection)
- [`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_rows_presenter.rs#L45)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### cache_length_property

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

Defines the `CacheLength` property.

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

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

### columns_property

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

Defines the `Columns` property.

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

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

### element_factory_property

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

Defines the `ElementFactory` property.

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

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

### items_property

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

Defines the `Items` property.

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

<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_rows_presenter.rs#L342)

<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_rows_presenter.rs#L357)

<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_rows_presenter.rs#L362)

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

### columns

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

The columns of the rows.

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

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

### set_columns

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



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

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

### cache_length

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

Gets or sets the additional row realization space before and after the viewport, expressed
as a multiple of the viewport height.

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

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

### set_cache_length

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



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

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

### element_factory

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

The factory of the rows and cells.

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

<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_rows_presenter.rs#L390)

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

### items

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

The rows the presenter shows.

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

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

### set_items

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



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

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

### realized_elements

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

The realized rows, with an empty slot for each row of the realized range that has no
element yet (`RealizedElements`).

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

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

### viewport

```rust
fn viewport(self: &Self) -> Rect
```

The effective viewport of the presenter (`Viewport`).

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

<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_rows_presenter.rs#L430)

<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 row at `index` into view (`BringIntoView`).

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

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

### get_realized_elements

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

The realized rows (`GetRealizedElements`).

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

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

### try_get_element

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

The realized row at `index`, if any (`TryGetElement`).

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

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

### recycle_all_elements

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

Recycles all the realized rows (`RecycleAllElements`).

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

<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 row changes (`ChildIndexChanged`). Disposing the
returned handle unsubscribes.

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

<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 rows (`UpdateSelection`).

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

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

### get_child_index

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

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

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

<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 rows (`IChildIndexProvider.TryGetTotalCount`).

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `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<TreeDataGridRowsPresenter>`](/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/)
- [`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/).
