DataGridColumnHeader.BorderThickness=0 对我有用,但不是 DataGridRow 或 DataGridCell,有什么想法吗?
<DataGrid x:Name="dg">
<DataGrid.Resources>
<Style TargetType="DataGrid">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style TargetType="DataGridColumnHeader">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Black" />
<Setter Property="BorderThickness" Value="0 0 0 1" />
</Style>
</DataGrid.Resources>
</DataGrid>
结果: