# ColumnBase

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

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

```rust
struct ColumnBase<M: 'static>
```

`ColumnBase<TModel>`: the state of a view column of models of `M`.

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

## Members

- [`new`](#function-new)
- [`property_changed`](#function-property_changed)
- [`notifying`](#function-notifying)
- [`actual_width`](#function-actual_width)
- [`width`](#function-width)
- [`header`](#function-header)
- [`set_header`](#function-set_header)
- [`options`](#function-options)
- [`column_options`](#function-column_options)
- [`sort_direction`](#function-sort_direction)
- [`set_sort_direction`](#function-set_sort_direction)
- [`tag`](#function-tag)
- [`set_tag`](#function-set_tag)
- [`id`](#function-id)
- [`is_visible`](#function-is_visible)
- [`set_is_visible`](#function-set_is_visible)
- [`presentation_key`](#function-presentation_key)
- [`set_presentation_key`](#function-set_presentation_key)
- [`can_user_resize`](#function-can_user_resize)
- [`min_actual_width`](#function-min_actual_width)
- [`max_actual_width`](#function-max_actual_width)
- [`star_width_was_constrained`](#function-star_width_was_constrained)
- [`requires_unconstrained_width_measurement`](#function-requires_unconstrained_width_measurement)
- [`cell_measured`](#function-cell_measured)
- [`calculate_star_width`](#function-calculate_star_width)
- [`commit_actual_width`](#function-commit_actual_width)
- [`set_width`](#function-set_width)

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

### new

```rust
fn new(header: Option<BoxedValue>, width: Option<GridLength>, options: Rc<dyn IColumnOptions<M>>) -> Self
```

The state of a column with `header`, `width` (`None`: `Auto`) and `options`.

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

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

### property_changed

```rust
fn property_changed(self: &Self) -> &Event<str>
```

The `PropertyChanged` of the column.

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

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

### notifying

```rust
fn notifying(self: &Self) -> &NotifyingBase
```

The notification helpers of the column.

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

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

### actual_width

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

The width of the column after measurement.

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

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

### width

```rust
fn width(self: &Self) -> GridLength
```

The width of the column; it is set through `IColumns::set_column_width`.

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

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

### header

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

The column header.

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

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

### set_header

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



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

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

### options

```rust
fn options(self: &Self) -> &ColumnOptions<M>
```

The options of the column.

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

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

### column_options

```rust
fn column_options(self: &Self) -> &Rc<dyn IColumnOptions<M>>
```

The options of the column as they were given.

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

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

### sort_direction

```rust
fn sort_direction(self: &Self) -> Option<ListSortDirection>
```

The sort direction indicator shown on the column. Setting it does not sort the data
(`ITreeDataGridSource::sort_by` does).

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

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

### set_sort_direction

```rust
fn set_sort_direction(self: &Self, value: Option<ListSortDirection>)
```



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

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

### tag

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

A user-defined object attached to the column.

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

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

### set_tag

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



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

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

### id

```rust
fn id(self: &Self) -> String
```

The identifier of the column as a core column: its header's text.

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

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

### is_visible

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



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

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

### set_is_visible

```rust
fn set_is_visible(self: &Self, value: bool)
```



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

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

### presentation_key

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



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

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

### set_presentation_key

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



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

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

### can_user_resize

```rust
fn can_user_resize(self: &Self) -> Option<bool>
```

`IColumn.CanUserResize`.

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

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

### min_actual_width

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

`IUpdateColumnLayout.MinActualWidth`.

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

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

### max_actual_width

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

`IUpdateColumnLayout.MaxActualWidth`.

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

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

### star_width_was_constrained

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

`IUpdateColumnLayout.StarWidthWasConstrained`.

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

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

### requires_unconstrained_width_measurement

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

`IColumnMeasurementOptions.RequiresUnconstrainedWidthMeasurement`.

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

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

### cell_measured

```rust
fn cell_measured(self: &Self, width: f64, _row_index: i32) -> f64
```

`IUpdateColumnLayout.CellMeasured`.

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

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

### calculate_star_width

```rust
fn calculate_star_width(self: &Self, available_width: f64, total_stars: f64)
```

`IUpdateColumnLayout.CalculateStarWidth`.
## Panics
When the column is not a star column (`InvalidOperationException`).

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

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

### commit_actual_width

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

`IUpdateColumnLayout.CommitActualWidth`.

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

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

### set_width

```rust
fn set_width(self: &Self, width: GridLength)
```

`IUpdateColumnLayout.SetWidth`: the preferred width; an absolute width is also the width
the column is laid out at.

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

## 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`

## Availability

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