# IColumns

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

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

```rust
trait IColumns
```

The columns of a presentation (`IColumns`).

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

## Members

- [`count`](#function-count)
- [`get`](#function-get)
- [`cell_measured`](#function-cell_measured)
- [`get_column_at`](#function-get_column_at)
- [`get_estimated_width`](#function-get_estimated_width)
- [`commit_actual_widths`](#function-commit_actual_widths)
- [`set_column_width`](#function-set_column_width)
- [`viewport_changed`](#function-viewport_changed)
- [`add_layout_invalidated`](#function-add_layout_invalidated)
- [`remove_layout_invalidated`](#function-remove_layout_invalidated)
- [`add_collection_changed`](#function-add_collection_changed)
- [`remove_collection_changed`](#function-remove_collection_changed)
- [`as_layout_batch`](#function-as_layout_batch)
- [`as_viewport_estimator`](#function-as_viewport_estimator)
- [`as_any`](#function-as_any)

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

### count

```rust
fn count(self: &Self) -> usize
```



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

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

### get

```rust
fn get(self: &Self, index: usize) -> ColumnRef
```



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

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

### cell_measured

```rust
fn cell_measured(self: &Self, column_index: i32, row_index: i32, size: Size) -> Size
```

The size a cell gets after it was measured at `size` (`CellMeasured`).

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

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

### get_column_at

```rust
fn get_column_at(self: &Self, x: f64) -> (i32, f64)
```

The index and left edge of the column at `x` (`GetColumnAt`).

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

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

### get_estimated_width

```rust
fn get_estimated_width(self: &Self, constraint: f64) -> f64
```



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

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

### commit_actual_widths

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



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

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

### set_column_width

```rust
fn set_column_width(self: &Self, column_index: i32, width: GridLength)
```



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

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

### viewport_changed

```rust
fn viewport_changed(self: &Self, viewport: Rect)
```



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

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

### add_layout_invalidated

```rust
fn add_layout_invalidated(self: &Self, handler: Rc<dyn Fn() -> ()>) -> u64
```

`LayoutInvalidated`.

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

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

### remove_layout_invalidated

```rust
fn remove_layout_invalidated(self: &Self, token: u64)
```



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

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

### add_collection_changed

```rust
fn add_collection_changed(self: &Self, handler: Rc<ColumnsChangedHandler>) -> u64
```

`CollectionChanged` (the columns as untyped view columns).

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

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

### remove_collection_changed

```rust
fn remove_collection_changed(self: &Self, token: u64)
```



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

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

### as_layout_batch

```rust
fn as_layout_batch(self: &Self) -> Option<&dyn IColumnLayoutBatch>
```

The column layout batch of the columns, if they batch width commits (`IColumnLayoutBatch`).

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

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

### as_viewport_estimator

```rust
fn as_viewport_estimator(self: &Self) -> Option<&dyn super::IColumnViewportEstimator>
```

The viewport estimation of the columns, if they estimate the widths of the columns not
realized (`IColumnViewportEstimator`).

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

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

### as_any

```rust
fn as_any(self: &Self) -> &dyn Any
```



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

## Trait implementations

- [`IColumns`](/docs/0.5.0/api/ferroui-controls-treedatagrid/models/trait-icolumns/)

## Availability

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