解决方案 »

  1.   


     <!--DataGridCellStyle-->
                    <Style TargetType="{x:Type DataGridCell}">
                        <Setter Property="SnapsToDevicePixels" Value="true"/>
                        <Setter Property="BorderBrush" Value="Transparent"/>
                        <Setter Property="Foreground" Value="White"></Setter>
                        <Setter Property="BorderThickness" Value="1"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type DataGridCell}">
                                    <Border BorderBrush="{TemplateBinding BorderBrush}" HorizontalAlignment="Center" VerticalAlignment="Center" BorderThickness="{TemplateBinding BorderThickness}" Background="Transparent" SnapsToDevicePixels="True">
                                        <ContentPresenter  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>                </Style>重写单元格 模板,再写一个转换类 Converter ,绑定到Background上。