---
title: "Expander Control in WPF"  
description: "In WPF XAML Expander element is used to create an expander control. Expander control is basically used for wrapping and expanding the content of items"  
author: "Anonymous User"  
published: 2011-04-12  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/545/expander-control-in-wpf  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# Expander Control in WPF

In WPF XAML <Expander /> element is used to create an expander control. Expander control is basically used for wrapping and expanding the content of items. You may have notice some websites provides a functionality to close and open controls. In this demonstration we learn that how to use expander control in WPF.\

##### A XAML code snippets which represent use of expander control

```
<Expander x:Name="expainder1" Background="#ccffff" Header="Expainder Control Demo" ExpandDirection="Down" IsExpanded="True" >            <Grid>                <Grid.RowDefinitions>                    <RowDefinition />                    <RowDefinition />                </Grid.RowDefinitions>                <Grid.ColumnDefinitions>                    <ColumnDefinition />                </Grid.ColumnDefinitions>                <Expander x:Name="expander1" Header="Employee Personal Information" Grid.Row="0" Grid.Column="0">                    <Label x:Name="lblMessage1" Content="Employee Personal Details" />                </Expander>                <Expander x:Name="expander2" Header="Student Personal Information" Grid.Column="0" Grid.Row="1">                    <Label x:Name="lblMessage2" Content="Student Personal Details" />                </Expander>            </Grid></Expander>
```

##### Output of the following code snippet is as follows

![Expander Control in WPF](https://www.mindstick.com/mindstickarticle/b7cb2b05-027b-47f6-b497-7e9ad77364d5/images/89828ffd-86cd-4fa3-a153-bf49359389ac.png)

![Expander Control in WPF](https://www.mindstick.com/mindstickarticle/b7cb2b05-027b-47f6-b497-7e9ad77364d5/images/15233a08-694c-495a-a2eb-bae36df7d816.png)

![Expander Control in WPF](https://www.mindstick.com/mindstickarticle/b7cb2b05-027b-47f6-b497-7e9ad77364d5/images/525de8e2-c482-45d3-aa20-d959ea6d472f.png)

---

Original Source: https://www.mindstick.com/articles/545/expander-control-in-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
