Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight whith SeparatorVisibility Collapsed in Headerstyle
    primarykey
    data
    text
    <p>I use the property "SeparatorVisibility" with the value "Collapsed" in a datagrid column header to disable the separator between the headers. It works fine when my zoom is "normal" in my navigator :</p> <p><img src="https://i.stack.imgur.com/0awd1.png" alt="enter image description here"></p> <p>but when zoom is using :</p> <p><img src="https://i.stack.imgur.com/u4q5j.png" alt="enter image description here"></p> <p>The separators are visible and I don't understand why!</p> <p>Here my ressource dictionary:</p> <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dataprimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data" xmlns:s="clr-namespace:System;assembly=mscorlib"&gt; &lt;!--Style de l'entête double ligne sans titre au dessus--&gt; &lt;Style x:Name="HeaderDoubleLine" TargetType="dataprimitives:DataGridColumnHeader" &gt; &lt;!--"#FFC9CACA"--&gt; &lt;Setter Property="Foreground" Value="#FF000000"/&gt; &lt;Setter Property="HorizontalContentAlignment" Value="Left"/&gt; &lt;Setter Property="VerticalContentAlignment" Value="Center"/&gt; &lt;Setter Property="IsTabStop" Value="False"/&gt; &lt;Setter Property="SeparatorBrush" Value="Transparent"/&gt; &lt;Setter Property="SeparatorVisibility" Value="Collapsed"/&gt; &lt;Setter Property="Padding" Value="8"/&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="dataprimitives:DataGridColumnHeader"&gt; &lt;Grid x:Name="Root"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition Width="Auto"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;VisualStateManager.VisualStateGroups&gt; &lt;VisualStateGroup x:Name="CommonStates"&gt; &lt;VisualState x:Name="Normal"/&gt; &lt;VisualState x:Name="MouseOver"&gt; &lt;Storyboard&gt; &lt;ColorAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Fill).Color" To="#FF448DCA"/&gt; &lt;ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[3].Color" To="#7FFFFFFF"/&gt; &lt;ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[2].Color" To="#CCFFFFFF"/&gt; &lt;ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[1].Color" To="#F2FFFFFF"/&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;VisualState x:Name="Pressed"&gt; &lt;Storyboard&gt; &lt;ColorAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Fill).Color" To="#FF448DCA"/&gt; &lt;ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[0].Color" To="#D8FFFFFF"/&gt; &lt;ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[1].Color" To="#C6FFFFFF"/&gt; &lt;ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[2].Color" To="#8CFFFFFF"/&gt; &lt;ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[3].Color" To="#3FFFFFFF"/&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;/VisualStateGroup&gt; &lt;VisualStateGroup x:Name="SortStates"&gt; &lt;VisualState x:Name="Unsorted"/&gt; &lt;VisualState x:Name="SortAscending" /&gt; &lt;VisualState x:Name="SortDescending" /&gt; &lt;/VisualStateGroup&gt; &lt;/VisualStateManager.VisualStateGroups&gt; &lt;Rectangle x:Name="BackgroundRectangle" Fill="#FF1F3B53" Stretch="Fill" Grid.ColumnSpan="2" /&gt; &lt;Rectangle x:Name="BackgroundGradient" Stretch="Fill" Grid.ColumnSpan="2"&gt; &lt;Rectangle.Fill&gt; &lt;LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0"&gt; &lt;GradientStop Color="#FCFFFFFF" Offset="0.015"/&gt; &lt;GradientStop Color="#F7FFFFFF" Offset="0.375"/&gt; &lt;GradientStop Color="#E5FFFFFF" Offset="0.6"/&gt; &lt;GradientStop Color="#D1FFFFFF" Offset="1"/&gt; &lt;/LinearGradientBrush&gt; &lt;/Rectangle.Fill&gt; &lt;/Rectangle&gt; &lt;StackPanel HorizontalAlignment="Stretch"&gt; &lt;Rectangle Margin="0,20,0,0" Fill="#FFC9CACA" VerticalAlignment="Stretch" Stretch="Fill" Width="Auto" Height="1" Visibility="Visible" /&gt; &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch"&gt; &lt;Rectangle Margin="-1,0,0,0" Fill="#FFC9CACA" VerticalAlignment="Stretch" HorizontalAlignment="Right" Stretch="Fill" Width="1" Height="20" Visibility="Visible" /&gt; &lt;ContentPresenter Margin="5,0,0,0" Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="right"/&gt; &lt;/StackPanel&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; </code></pre> <p></p> <p>I apply this style header on each column header that I want to change.</p>
    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. 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