# Getting Started with WinForms CollapsiblePanel

This tutorial will help you to quickly get started using the control.

## Adding Telerik Assemblies Using NuGet

To use `RadCollapsiblePanel` when working with NuGet packages, install the `Telerik.UI.for.WinForms.AllControls` package. The [package target framework version may vary](https://www.telerik.com/products/winforms/documentation/visual-studio-integration/available-nugets).

Read more about NuGet installation in the [Install using NuGet Packages](https://www.telerik.com/products/winforms/documentation/installation-and-upgrades/install-using-nuget) article.

> tip With the 2025 Q1 release, the Telerik UI for WinForms has a new licensing mechanism. You can learn more about it [here](https://www.telerik.com/products/winforms/documentation/licensing/license-key).

## Adding Assembly References Manually

When dragging and dropping a control from the Visual Studio (VS) Toolbox onto the Form Designer, VS automatically adds the necessary assemblies. However, if you're adding the control programmatically, you'll need to manually reference the following assemblies:

* **Telerik.Licensing.Runtime**
* **Telerik.WinControls**
* **Telerik.WinControls.UI**
* **TelerikCommon**

The Telerik UI for WinForms assemblies can be install by using one of the available [installation approaches](https://www.telerik.com/products/winforms/documentation/installation-and-upgrades/installing-on-your-computer).

## Defining the RadCollapsiblePanel

**RadCollapsiblePanel** can host many controls in its controls container area, which then can be collapsed. This way you will be able to save space in your application as the control can use as much space as it needs for its header.

In this article you will learn the basics of how to use RadCollapsiblePanel. We will recreate a scenario where you have a [RadGridView](https://www.telerik.com/products/winforms/documentation/controls/gridview/overview) which you do not want to show at all times. This is how our Form will look like when we finish if **RadCollapsiblePanel** is collapsed.

> caption Figure 1: Collapsed Panel

![WinForms RadTemplates Collapsed Panel](https://www.telerik.com/products/winforms/documentation/assets/7b84a890a989340837d6e9a2f6727a49/panels-and-labels-collapsible-panel-getting-started001.png)

And this is how it will look if the panel is expanded.

> caption Figure 2: Expanded Panel

![WinForms RadTemplates Expanded Panel](https://www.telerik.com/products/winforms/documentation/assets/8c4c3acee08ef48cd4e1ceb6cae91fc9/panels-and-labels-collapsible-panel-getting-started002.png)

1\. Create a **RadForm** and add a few controls (buttons in our case) on the left side of the form, but leave about 30 pixels to the form’s border. These controls will be visible only when **RadCollapsiblePanel** is collapsed.

![WinForms RadTemplates panels-and-labels-collapsible-panel-getting-started 003](https://www.telerik.com/products/winforms/documentation/assets/63abe101930da43605554f8d45d99af9/panels-and-labels-collapsible-panel-getting-started003.png)

2\. Now drag a **RadCollapsiblePanel** control from the Toolbox of Visual Studio onto the form. Drag it to the top-left corner of the form and increase its height so it fits the height of the form. From the Property Window set the following properties

* **ExpandDirection**: *Right*

* **Anchor**: *Top, Left, Botton*

* **HeaderText**: *"ShowGrid"*

  ![WinForms RadTemplates panels-and-labels-collapsible-panel-getting-started 004](https://www.telerik.com/products/winforms/documentation/assets/639eecd41c56a202b523fcfd38e7b878/panels-and-labels-collapsible-panel-getting-started004.png)

3\. Increase the panel's width to at least the half of the form. After this is ready drag a **RadGridView** to the controls container of the **RadCollapsiblePanel** instance you just created and set the following properties to the grid:

* **Dock**: *Fill*

* **DataSource**: *This is optional, you can read how to bind RadGridView* [WinForms RadTemplates here](https://www.telerik.com/products/winforms/documentation/controls/gridview/populating-with-data/databinding-radgridview)<br>![WinForms RadTemplates panels-and-labels-collapsible-panel-getting-started 002](https://www.telerik.com/products/winforms/documentation/assets/8c4c3acee08ef48cd4e1ceb6cae91fc9/panels-and-labels-collapsible-panel-getting-started002.png)

#### Handle Events

```C#
void radCollapsiblePanel1_Collapsed(object sender, EventArgs e)
{
    this.radCollapsiblePanel1.HeaderText = "Show Grid";
}

void radCollapsiblePanel1_Expanded(object sender, EventArgs e)
{
    this.radCollapsiblePanel1.HeaderText = "Hide Grid";
}

```

```VB.NET
Private Sub radCollapsiblePanel1_Collapsed(sender As Object, e As EventArgs)
    Me.RadCollapsiblePanel1.HeaderText = "Show Grid"
End Sub

Private Sub radCollapsiblePanel1_Expanded(sender As Object, e As EventArgs)
    Me.RadCollapsiblePanel1.HeaderText = "Hide Grid"
End Sub
```

Our example is ready to be tested. You can start the application and observe the following:

> caption Figure 3: End Result

![WinForms RadTemplates End Result](https://www.telerik.com/products/winforms/documentation/assets/fbb509e1f81d3e0bb1fe588204b69b15/panels-and-labels-collapsible-panel-getting-started005.gif)

## See Also

* [Structure](https://www.telerik.com/products/winforms/documentation/controls/panels-and-labels/collapsiblepanel/structure)
* [Design Time](https://www.telerik.com/products/winforms/documentation/controls/panels-and-labels/collapsiblepanel/design-time)

## Telerik UI for WinForms Learning Resources

* [Getting Started with Telerik UI for WinForms Components](https://docs.telerik.com/devtools/winforms/getting-started/first-steps)
* [Telerik UI for WinForms Setup](https://docs.telerik.com/devtools/winforms/installation-and-upgrades/installing-on-your-computer)
* [Telerik UI for WinForms Converter](https://www.telerik.com/products/winforms/documentation/ai-coding-assistant/converter/converter)
* [Telerik UI for WinForms Visual Studio Templates](https://docs.telerik.com/devtools/winforms/visual-studio-integration/visual-studio-templates)
* [Deploy Telerik UI for WinForms Applications](https://docs.telerik.com/devtools/winforms/deployment-and-distribution/application-deployment)
* [Telerik UI for WinForms Virtual Classroom(Training Courses for Registered Users)](https://learn.telerik.com/learn/course/external/view/elearning/17/telerik-ui-for-winforms)
* [Telerik UI for WinForms License Agreement)](https://www.telerik.com/purchase/license-agreement/winforms-dlw-s)
