RadControls for WPF

Declaring a RadExpander

The RadExpander is a HeaderedContentControl andwe can initialize both the Header and the Content properties.

Note

In order to use RadExpander in your projects you need to add reference to the following assemblies:

  • Telerik.Windows.Controls
  • Telerik.Windows.Controls.Navigation
  • Telerik.Windows.Data

You can find more info here.

CopyXAML
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

Declaring more complex Header and Content

If the information in the Header and/or the Content is more complex then we can rely on the XML Element initializing technique. Below is the sample xaml-code:

CopyXAML
<telerik:RadExpander>
    <telerik:RadExpander.Header>
        <Grid HorizontalAlignment="Stretch">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <TextBlock Text="Header" />
            <Rectangle Grid.Column="1" 
                       Height="2"
                       Margin="5,0,0,0"
                       VerticalAlignment="Center"
                       Fill="Gray" />
        </Grid>
    </telerik:RadExpander.Header>
    <StackPanel Orientation="Vertical">
        <Ellipse Width="33" 
                 Height="33"
                 Margin="5"
                 Fill="Yellow" />
        <Ellipse Width="33" 
                 Height="33"
                 Margin="5"
                 Fill="Blue" />
        <Ellipse Width="33" 
                 Height="33"
                 Margin="5"
                 Fill="Red" />
    </StackPanel>
</telerik:RadExpander>