# RadPane Activation

There are two possible approaches for activating/deactivating a pane - using the **ActivePane** property of the **RadDocking** control or using the **IsActive** property of the **RadPane**. Both approaches will lead to the same final result but could be used in different scenarios. Using the IsActive property of the RadPane is useful when you want to activate a pane but do not have a reference to the RadDocking control itself.

**Examples 1 and 2** show how to activate panes through the IsActive property.

**Example 1: Activate panes**

```XAML
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Button Content="Set IsActive" Click="Button_Click"/>
    <telerik:RadDocking Grid.Row="1" >
        <telerik:RadSplitContainer>
            <telerik:RadPaneGroup>
                <telerik:RadPane Header="Pane 1" IsActive="True"/>
                <telerik:RadPane Header="Pane 2"/>
                <telerik:RadPane Header="Pane 3" x:Name="Pane3"/>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
    </telerik:RadDocking>
</Grid>
```

**Example 2: Activate panes**

```C#
private void Button_Click(object sender, RoutedEventArgs e)
{
    this.Pane3.IsActive = true;
}
```

```VB.NET
Private Sub Button_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
	Me.Pane3.IsActive = True
End Sub
```

## PaneActivationMode

By default the next non-disabled and visible **RadPane** in the PaneGroup is activated when the current active one is closed.

RadDocking's **PaneActivationMode** property controls which RadPane should be focused/activated after another RadPane in its PaneGroup is closed. It is of type **ActivationMode** and can be set to the following values:

* **First**: Activates the first non-disabled and visible **RadPane** in the Items collection of the PaneGroup and if there isn't one - the first non-disabled and visible **RadPane** in the Items collection of **RadDocking** is activated.

* **Last**: Activates the last non-disabled and visible **RadPane** in the Items collection of the PaneGroup and if there isn't one - the first non-disabled and visible **RadPane** in the Items collection of **RadDocking** is activated.

* **Previous**: Activates the previous non-disabled and visible **RadPane** in the Items collection of the PaneGroup and if there isn't one - the first non-disabled and visible **RadPane** in the Items collection of **RadDocking** is activated.

* **Next**: *This is the default mode*. Activates the next non-disabled and visible **RadPane** in the Items collection of the PaneGroup and if there isn't one - the first non-disabled and visible **RadPane** in the Items collection of **RadDocking** is activated.

* **LastActivated**: Activates the previous activated **RadPane** in the Items collection of the PaneGroup and if there isn't one - the first non-disabled and visible **RadPane** in the Items collection of **RadDocking** is activated.

> If no pane can be activated no action is performed and the value of the **ActivePane** property is set to **null**.

Figures 1 through 4 will demonstrate the expected behaviors when using the above modes

> caption Pane 1 is activated after closing pane 4 with ActivationMode.First

![Pane 1 is activated after closing Pane 4 with ActivationMode.First](https://www.telerik.com/products/wpf/documentation/assets/1a79d47f2ede8e53d046e6f1d3ed8d6f/raddocking-features-panes-activation-mode-1.png)

> caption Pane 5 is activated after closing pane 3 with ActivationMode.Last

![Pane 5 is activated after closing Pane 3 with ActivationMode.First](https://www.telerik.com/products/wpf/documentation/assets/552ca184727b1c510d569a6391ae0525/raddocking-features-panes-activation-mode-2.png)

> caption Pane 2 is activated after closing pane 1 with ActivationMode.Next

![Pane 2 is activated after closing Pane 1 with ActivationMode.Next](https://www.telerik.com/products/wpf/documentation/assets/fc966332e90613c1e85989fdeb306e50/raddocking-features-panes-activation-mode-3.png)

> caption Pane 3 is activated after closing pane 5 with ActivationMode.LastActivated

![raddocking-features-panes-activation-mode-4](https://www.telerik.com/products/wpf/documentation/assets/00244e094bfaa739050375f59e5782bf/raddocking-features-panes-activation-mode-4.png)

> Notice that Pane 3 was the last active pane before closing Pane 5
