# IDataTemplateSelector

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls-repeater/trait-idatatemplateselector/

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

```rust
trait IDataTemplateSelector
```

Selects a template based on data and, optionally, the requesting container.
The second overload is consulted only when the first returns no template.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/item_template_wrapper.rs#L18)

## Members

- [`select_template`](#function-select_template)
- [`select_template_with_container`](#function-select_template_with_container)
- [`try_select_template`](#function-try_select_template)
- [`try_select_template_with_container`](#function-try_select_template_with_container)

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

### select_template

```rust
fn select_template(self: &Self, item: Option<&BoxedValue>) -> Option<Rc<dyn IDataTemplate>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/item_template_wrapper.rs#L19)

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

### select_template_with_container

```rust
fn select_template_with_container(self: &Self, item: Option<&BoxedValue>, container: Option<&Ref<Control>>) -> Option<Rc<dyn IDataTemplate>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/item_template_wrapper.rs#L20)

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

### try_select_template

```rust
fn try_select_template(self: &Self, item: Option<&BoxedValue>) -> Result<Option<Rc<dyn IDataTemplate>>, ElementFactoryError>
```

Fallible selectors retain their own error when the item or container
overload fails. Returning no template is the only container fallback.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/item_template_wrapper.rs#L27)

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

### try_select_template_with_container

```rust
fn try_select_template_with_container(self: &Self, item: Option<&BoxedValue>, container: Option<&Ref<Control>>) -> Result<Option<Rc<dyn IDataTemplate>>, ElementFactoryError>
```



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

## Availability

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