# Selection

The selection feature of TabControl allows you to change the current tab using click or the control's API.

The selection is controlled using the `SelectedItem` and `SelectedIndex` properties of `RadTabControl`. The `SelectedItem` should contain an item from the `Items` collection of the control. The `SelectedIndex` contains the collection index of the selected item.

#### **Setting SelectedItem**

```C#
this.tabControl.SelectedItem = this.tabControl.Items[1];
```

#### **Setting SelectedIndex**

```XAML
<telerik:RadTabControl SelectedIndex="1"/>
```

The selection can be set also by using the `IsSelected` property of `RadTabItem`.

#### **Setting IsSelected**

```XAML
<telerik:RadTabControl>
	<telerik:RadTabItem Header="Calendar"/>
	<telerik:RadTabItem Header="Colors" IsSelected="True"/>
	<telerik:RadTabItem Header="Quote"/>
</telerik:RadTabControl>
```

## Clear the Selection

To clear the selection, set the **SelectedIndex** property of `RadTabControl` to `-1`.

#### **Clearing the selection**

```XAML
<telerik:RadTabControl SelectedIndex="-1"/>
```

## Selection Behavior on Removing Tab

TabControl allows you to control the selection behavior in case the selected tab is removed. This is done using the `SelectedItemRemoveBehaviour` property of `RadTabControl`. The property is of type enum which provides the following values:

* `SelectNone`—No item is selected. Sets the `SelectedItem` property to `null`.

* `SelectFirst`—The first item in the `Items` collection is selected.

* `SelectLast`—The last item in the `Items` collection is selected.

* `SelectPrevious`—The item that is positioned before the removed one is selected.

* `SelectNext`—The item that is positioned after the removed one is selected.

#### **Setting SelectFirst**

```XAML
<telerik:RadTabControl SelectedItemRemoveBehaviour="SelectFirst"/>
```

## See Also

* [Getting Started](https://www.telerik.com/winui/documentation/controls/radtabcontrol/getting-started)
* [Preserve Selected Content](https://www.telerik.com/winui/documentation/controls/radtabcontrol/preserve-selected-content)
* [Visual Structure](https://www.telerik.com/winui/documentation/controls/radtabcontrol/visual-structure)
