wpf - 数据网格 : How to remove black inner borders?

标签 wpf

我有一个数据网格:

<DataGrid x:Name="gvImports" 
    HorizontalAlignment="Left" 
    AutoGenerateColumns="False" 
    Margin="10,36.816,0,0" 
    VerticalAlignment="Top" 
    Height="163.087" Width="485.05">
</DataGrid>

然后我在 C# 中设置单元格边框样式:
var cellStyle = new Style(typeof(DataGridCell));
cellStyle.Setters.Add
      (new Setter(DataGridCell.BorderBrushProperty, Brushes.Magenta));
gvImports.CellStyle = cellStyle;

注意攻击性洋红色仅用于演示目的。

这是渲染时 DataGrid 的图像:

enter image description here

我想摆脱那些内部的黑线,知道这是怎么做的吗?

最佳答案

gvImports.GridLinesVisibility = DataGridGridLinesVisibility.None; 

关于wpf - 数据网格 : How to remove black inner borders?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17797580/

相关文章:

c# - 如何在 WPF 中创建一组单选菜单项?

c# - 是否可以更改 WPF 控件的父级

c# - 绑定(bind)中的 WPF StringFormat 在代码隐藏中不起作用

c# - 两个 View 模型之间的通信

行高度可变的WPF DataGrid

WPF Ribbon - 隐藏标签页眉(单标签应用程序)

c# - 用户控件的 WPF 布局作为运行

c# - 在 WPF 中快速渲染绘图视觉效果

WPF 弹出窗口出现在其他桌面窗口上,如何只出现在 WPF 主窗口的顶部?

wpf - 错误 : This PlotModel is already in use by some other PlotView control