/ / wpf datagridセルの背景色が完全に塗りつぶされない - wpf、datagrid

wpfデータグリッドセルの背景色が完全に塗りつぶされない - wpf、datagrid

背景色は、セルとグリッド線の間に小さなスペースを残します。それを完全に埋めるにはどうすればよいですか。 padding / margin = 0を試してみました。

スクリーンショット: http://s21.postimg.org/xqe4mt4dv/Data_Grid_Cell_Background.png

スタイリングの専門家はいますか?

 <DataGrid ItemsSource="{Binding}" >
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Background" Value="Red"/>
</Style>
</DataGrid.CellStyle>
</DataGrid>


Data = new Dictionary<int,string>();
for (int i = 0; i < 5; i++)
Data.Add(i, "Text");
DataContext = Data;

回答:

回答№1は2

これは簡単です。 BorderThickness0

<DataGrid ItemsSource="{Binding}" >
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Background" Value="Red"/>
<Setter Property="BorderThickness" Value="0" />
</Style>
</DataGrid.CellStyle>
</DataGrid>

次回はなぜ物事がどう見えるかを知りたい彼らは見て、Snoopを試してみる。コントロールとパネル、およびそれらのプロパティ(この場合は、Margin、Padding、またはBorderThicknessのいずれか)を確認して、XAMLから調整する必要があるものを確認します。