这应该让你开始: –
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
BorderBrush="White"
BorderThickness="2"
Background="Black"
CornerRadius="5">
RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}"
Background="Black" Foreground="White" ItemsSource="{Binding MyData}" />
其中大部分是通过重新模板化DataGridCell来完成的.内边框创建圆角,而外边框确保圆角周围的“空间”中有黑色背景.
我还添加了一个触发器来设置所选单元格的背景颜色. DataGrid配置为单细胞选择 – 看起来你的将是“多个”.