2
背景颜色在网格线之间留下很小的空间。我怎样才能使它完全填充?我试图尝试填充/保证金= 0wpf datagrid单元格背景颜色不完全填充
截图:
任何造型专家在那里?
<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;
这会使选择边框消失,但对于真正的迷恋,您可以在“样式”中为“IsSelected”添加一个“触发器”,并将边框厚度重置为1。 – Tekito