title: show grid in expander.
body: <p>I m trying to create the expander with the header on right side and than add a grid to that exapnder. when i run this grids textblock doesnt apper. And like to know what are best way to create expander header on right side.  </p>
  
  <pre><code>&lt;StackPanel &gt;
              &lt;Expander Header="Customer Detail" IsExpanded="False" Style="{StaticResource MainViewExpander}"  &gt;
                  &lt;Expander.Content&gt;
                      &lt;StackPanel HorizontalAlignment="Stretch"&gt;
                      &lt;Grid x:Name="ImageInformation"  Margin="0"&gt;
                          &lt;Grid.ColumnDefinitions&gt;
                              &lt;ColumnDefinition Width="1.8*"/&gt;
                              &lt;ColumnDefinition Width="1.4*"/&gt;
                              &lt;ColumnDefinition Width="2.8*"/&gt;
                          &lt;/Grid.ColumnDefinitions&gt;
                          &lt;Grid.RowDefinitions&gt;
                              &lt;RowDefinition Height="0.9*" /&gt;
                              &lt;RowDefinition Height="0.7*" /&gt;
                              &lt;RowDefinition Height="0.7*" /&gt;
                          &lt;/Grid.RowDefinitions&gt;
                          &lt;Image Source="{Binding XPath=x.null}" Grid.Column="0" Grid.RowSpan="3"/&gt;
                          &lt;TextBlock Name="Customername" 
                                     Grid.Column="1" 
                                     Grid.ColumnSpan="2" 
                                     Text="Customer Name" 
                                     HorizontalAlignment="Left" 
                                     VerticalAlignment="Bottom" 
                                     TextWrapping="NoWrap" Margin="0,0,0,13" Width="140" Height="22"/&gt;
                          &lt;TextBlock Name="Born" 
                                     Grid.Column="1" 
                                     Grid.Row="1" 
                                     Text="Born" 
                                     HorizontalAlignment="Left" 
                                     VerticalAlignment="Center" 
                                     TextWrapping="NoWrap" Margin="2" Width="60" /&gt;
                          &lt;TextBlock Name="BornDetail" 
                                     Grid.Column="2" 
                                     Grid.Row="1" 
                                     Text="BornDetail" 
                                     HorizontalAlignment="Left" 
                                     VerticalAlignment="Center" 
                                     TextWrapping="NoWrap" Margin="2" Width="125" /&gt;
                          &lt;TextBlock Name="Speak" 
                                     Grid.Column="1" 
                                     Grid.Row="2" 
                                     Text="Speak" 
                                     HorizontalAlignment="Left" 
                                     VerticalAlignment="Center" 
                                     TextWrapping="NoWrap" Margin="2" Width="60" /&gt;
                          &lt;TextBlock Name="SpeakDetail" 
                                     Grid.Column="2" 
                                     Grid.Row="2" 
                                     Text="Speak" 
                                     HorizontalAlignment="Left" 
                                     VerticalAlignment="Center" 
                                     TextWrapping="NoWrap" Margin="2" Width="125" Height="16" MaxHeight="20" MaxWidth="135"/&gt;
  
                      &lt;/Grid&gt;
                      &lt;Grid Height="150" Width="295"&gt;
                          &lt;Grid.ColumnDefinitions&gt;
                              &lt;ColumnDefinition Width="1*" &gt;&lt;/ColumnDefinition&gt;
                              &lt;ColumnDefinition Width="2*"&gt;&lt;/ColumnDefinition&gt;
                          &lt;/Grid.ColumnDefinitions&gt;
                          &lt;Grid.RowDefinitions&gt;
                              &lt;RowDefinition Height="1.2*"&gt;&lt;/RowDefinition&gt;
                              &lt;RowDefinition Height="1.2*"&gt;&lt;/RowDefinition&gt;
                              &lt;RowDefinition Height="1.2*"&gt;&lt;/RowDefinition&gt;
                              &lt;RowDefinition Height="1.2*"&gt;&lt;/RowDefinition&gt;
                              &lt;RowDefinition Height="1.2*"&gt;&lt;/RowDefinition&gt;
                              &lt;RowDefinition Height="1.2*"&gt;&lt;/RowDefinition&gt;
                              &lt;RowDefinition Height="1.2*"&gt;&lt;/RowDefinition&gt;
                              &lt;RowDefinition Height="1.2*"&gt;&lt;/RowDefinition&gt;
                              &lt;RowDefinition Height="1.2*"&gt;&lt;/RowDefinition&gt;
                          &lt;/Grid.RowDefinitions&gt;
  
                          &lt;TextBlock Text="" Grid.Column="0" Grid.Row="0" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="1" Grid.Row="0" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="0" Grid.Row="1" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="1" Grid.Row="1" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="0" Grid.Row="2" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="1" Grid.Row="2" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="0" Grid.Row="3" TextWrapping="Wrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="1" Grid.Row="3" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="0" Grid.Row="4" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="1" Grid.Row="4" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="0" Grid.Row="5" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="1" Grid.Row="5" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="0" Grid.Row="6" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="1" Grid.Row="6" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="0" Grid.Row="7" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="1" Grid.Row="7" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="0" Grid.Row="8" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="1" Grid.Row="8" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="0" Grid.Row="9" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                          &lt;TextBlock Text="" Grid.Column="1" Grid.Row="9" TextWrapping="NoWrap" HorizontalAlignment="Left"&gt;&lt;/TextBlock&gt;
                      &lt;/Grid&gt;
                     &lt;/StackPanel&gt;
                  &lt;/Expander.Content&gt;
              &lt;/Expander&gt;
   &lt;/StackPanel&gt;
  </code></pre>
  
  <p>My stylesheet is something like this:</p>
  
  <pre><code>&lt;UserControl.Resources &gt;
          &lt;!-- Main Expander Header Brushes --&gt;
          &lt;SolidColorBrush x:Key="MainExpanderHeaderBackgroundBrush" Color="#FF3771C1"/&gt;
          &lt;SolidColorBrush x:Key="MainExpanderHeaderBorderBrush" Color="Black"/&gt;
  
          &lt;!-- Main Expander Content Brushes --&gt;
          &lt;SolidColorBrush x:Key="MainExpanderContentBorderBrush" Color="Black" /&gt;
  
          &lt;!-- Main Expander Control Brushes (affect the whole control, not just header or content --&gt;
          &lt;SolidColorBrush x:Key="MainExpanderControlNormalForegroundBrush" Color="White" /&gt;
          &lt;SolidColorBrush x:Key="MainExpanderControlDisabledForegroundBrush" Color="DarkGray" /&gt;
          &lt;SolidColorBrush x:Key="MainExpanderControlDisabledBackgroundBrush" Color="LightGray" /&gt;
          &lt;SolidColorBrush x:Key="MainExpanderControlDisabledBorderBrush" Color="LightGray" /&gt;
  
          &lt;!-- Main Expander Toggle Button Brushes --&gt;
          &lt;SolidColorBrush x:Key="ExpanderToggleButtonBackgroundBrush" Color="White" /&gt;
          &lt;SolidColorBrush x:Key="ExpanderToggleButtonMouseOverFillBrush" Color="Green" /&gt;
          &lt;SolidColorBrush x:Key="ExpanderToggleButtonPressedFillBrush" Color="Yellow" /&gt;
  
          &lt;!-- Expander Toggle Button Template --&gt;
          &lt;ControlTemplate x:Key="ExpanderToggleButton" TargetType="ToggleButton"&gt;
  
              &lt;!-- Note, the chevron toggle button gets its forground color from the templated parent.
               The parent must set this to a valid color when it is disabled. --&gt;
  
              &lt;Path 
              Name="Chevron"
              HorizontalAlignment="Center"
              VerticalAlignment="Center"
              Data="M 0 0 L 10 10 L 20 0 Z"
              Fill="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Foreground}"
              /&gt;
  
              &lt;ControlTemplate.Triggers&gt;
                  &lt;Trigger Property="IsChecked" Value="true"&gt;
                      &lt;Setter TargetName="Chevron" Property="Data" Value="M 0 10 L 10 0 L 20 10 Z" /&gt;
                  &lt;/Trigger&gt;
                  &lt;Trigger Property="ToggleButton.IsMouseOver" Value="true"&gt;
                      &lt;Setter TargetName="Chevron" Property="Fill" Value="{StaticResource ExpanderToggleButtonMouseOverFillBrush}" /&gt;
                  &lt;/Trigger&gt;
                  &lt;Trigger Property="IsPressed" Value="true"&gt;
                      &lt;Setter TargetName="Chevron" Property="Fill" Value="{StaticResource ExpanderToggleButtonPressedFillBrush}" /&gt;
                  &lt;/Trigger&gt;
              &lt;/ControlTemplate.Triggers&gt;
          &lt;/ControlTemplate&gt;
  
          &lt;Style x:Key="MainViewExpander" TargetType="Expander"&gt;
              &lt;Setter Property="Foreground" Value="{StaticResource MainExpanderControlNormalForegroundBrush}"/&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="Expander"&gt;
                          &lt;Grid&gt;
                              &lt;Grid.RowDefinitions&gt;
                                  &lt;RowDefinition Height="Auto"/&gt;
                                  &lt;RowDefinition Name="ContentRow"/&gt;
                              &lt;/Grid.RowDefinitions&gt;
                              &lt;Border 
                                  Name="HeaderBorder" 
                                  Grid.Row="0" 
                                  BorderThickness="1" 
                                  CornerRadius="0,0,0,0" 
                                  BorderBrush="{StaticResource MainExpanderHeaderBorderBrush}"
                                  Background="{StaticResource MainExpanderHeaderBackgroundBrush}"
                                  &gt;
  
                                  &lt;Grid &gt;
                                      &lt;Grid.ColumnDefinitions&gt;
                                          &lt;ColumnDefinition Width="*" /&gt;
                                          &lt;ColumnDefinition Width="20" /&gt;
                                      &lt;/Grid.ColumnDefinitions&gt;
  
                                      &lt;ContentPresenter 
                                          Grid.Column="0"
                                          Margin="4" 
                                          ContentSource="Header" 
                                          RecognizesAccessKey="True" 
                                          /&gt;
                                      &lt;ToggleButton 
                                          Grid.Column="1"
                                          IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                          OverridesDefaultStyle="True" 
                                          Template="{StaticResource ExpanderToggleButton}" 
                                          Background="{StaticResource ExpanderToggleButtonBackgroundBrush}" 
                                          /&gt;
                                  &lt;/Grid&gt;
                              &lt;/Border&gt;
  
                              &lt;Border 
                                  Name="ContentBorder" 
                                  Grid.Row="1" 
                                  BorderBrush="{StaticResource MainExpanderContentBorderBrush}" 
                                  BorderThickness="1,0,1,1" 
                                  CornerRadius="0,0,0,0" 
                                  &gt;
                                  &lt;ContentPresenter Margin="4" /&gt;
  
                              &lt;/Border&gt;
                          &lt;/Grid&gt;
  
                          &lt;!-- Triggers for the entire Expander Control --&gt;
                          &lt;ControlTemplate.Triggers&gt;
  
                              &lt;Trigger Property="IsExpanded" Value="True"&gt;
                                  &lt;Setter TargetName="ContentRow" Property="Height" Value="{Binding ElementName=Content, Path=DesiredHeight}" /&gt;
                              &lt;/Trigger&gt;
  
                              &lt;Trigger Property="IsEnabled" Value="False"&gt;
                                  &lt;Setter Property="Foreground" Value="{StaticResource MainExpanderControlDisabledForegroundBrush}"/&gt;
                                  &lt;Setter TargetName="HeaderBorder" Property="Background" Value="{StaticResource MainExpanderControlDisabledBackgroundBrush}" /&gt;
                                  &lt;Setter TargetName="HeaderBorder" Property="BorderBrush" Value="{StaticResource MainExpanderControlDisabledBorderBrush}" /&gt;
                                  &lt;Setter TargetName="ContentBorder" Property="BorderBrush" Value="{StaticResource MainExpanderControlDisabledBorderBrush}" /&gt;
                              &lt;/Trigger&gt;
  
                          &lt;/ControlTemplate.Triggers&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
  
              &lt;Setter Property="HeaderTemplate"&gt;
                  &lt;Setter.Value&gt;
                      &lt;DataTemplate&gt;
                          &lt;TextBlock Text="{Binding}" 
                              Foreground="{StaticResource MainExpanderControlNormalForegroundBrush}" 
                              FontSize="18" 
                              FontWeight="Bold"
                              /&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
  
          &lt;/Style&gt;
  
          &lt;Style x:Key="MainViewExpanderCommands" 
             BasedOn="{StaticResource MainViewExpander}"  
             TargetType="Expander"
             &gt;
              &lt;Setter Property="FontSize" Value="20" /&gt;
              &lt;Setter Property="FontWeight" Value="Bold" /&gt;
          &lt;/Style&gt;
      &lt;/UserControl.Resources &gt;
  </code></pre>
  
  <p>so how to get the data of grid in expander?</p>