Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think you're gonna have to re-template the DataGridColumnHeader and add it from there. Here's an example. You're gonna have to add a reference to PresentationFramework.Aero</p> <pre><code>xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" &lt;DataGrid ...&gt; &lt;DataGrid.Resources&gt; &lt;Style x:Key="ColumnHeaderGripperStyle" TargetType="{x:Type Thumb}"&gt; &lt;Setter Property="Width" Value="8"/&gt; &lt;Setter Property="Background" Value="Transparent"/&gt; &lt;Setter Property="Cursor" Value="SizeWE"/&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="{x:Type Thumb}"&gt; &lt;Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"/&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; &lt;Style TargetType="{x:Type DataGridColumnHeader}"&gt; &lt;Setter Property="Background" Value="Blue"/&gt; &lt;Setter Property="BorderBrush" Value="Red"/&gt; &lt;Setter Property="BorderThickness" Value="1,1,1,1"/&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="{x:Type DataGridColumnHeader}"&gt; &lt;Grid&gt; &lt;Themes:DataGridHeaderBorder BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" IsClickable="{TemplateBinding CanUserSort}" IsPressed="{TemplateBinding IsPressed}" IsHovered="{TemplateBinding IsMouseOver}" Padding="{TemplateBinding Padding}" SortDirection="{TemplateBinding SortDirection}" SeparatorBrush="{TemplateBinding SeparatorBrush}" SeparatorVisibility="{TemplateBinding SeparatorVisibility}"&gt; &lt;Grid&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="Auto"/&gt; &lt;ColumnDefinition Width="*"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;ContentPresenter Grid.Column="0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/&gt; &lt;Path x:Name="SortArrow" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Width="8" Height="6" Margin="2,0,5,0" Stretch="Fill" Opacity="0.5" Fill="White" RenderTransformOrigin="0.5,0.4" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" /&gt; &lt;/Grid&gt; &lt;/Themes:DataGridHeaderBorder&gt; &lt;Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" Style="{StaticResource ColumnHeaderGripperStyle}"/&gt; &lt;Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" Style="{StaticResource ColumnHeaderGripperStyle}"/&gt; &lt;/Grid&gt; &lt;ControlTemplate.Triggers&gt; &lt;Trigger Property="SortDirection" Value="Ascending"&gt; &lt;Setter TargetName="SortArrow" Property="Visibility" Value="Visible" /&gt; &lt;Setter TargetName="SortArrow" Property="RenderTransform"&gt; &lt;Setter.Value&gt; &lt;RotateTransform Angle="180" /&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Trigger&gt; &lt;Trigger Property="SortDirection" Value="Descending"&gt; &lt;Setter TargetName="SortArrow" Property="Visibility" Value="Visible" /&gt; &lt;/Trigger&gt; &lt;/ControlTemplate.Triggers&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; &lt;/DataGrid.Resources&gt; &lt;/DataGrid&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload