【发布时间】:2017-10-04 07:28:55
【问题描述】:
我已将DataGrid 添加到我的 WPF 窗口中,并在 XAML 中设置了 VerticalGridLinesBrush 属性以显示相关颜色的垂直网格线。但我不知道如何增加在DataGridRow 中显示的垂直网格线的宽度。
谁能告诉我如何在 WPF DataGrid 中设置垂直网格线的粗细?
【问题讨论】:
标签: wpf xaml datagrid wpfdatagrid
我已将DataGrid 添加到我的 WPF 窗口中,并在 XAML 中设置了 VerticalGridLinesBrush 属性以显示相关颜色的垂直网格线。但我不知道如何增加在DataGridRow 中显示的垂直网格线的宽度。
谁能告诉我如何在 WPF DataGrid 中设置垂直网格线的粗细?
【问题讨论】:
标签: wpf xaml datagrid wpfdatagrid
设置此属性
GridLinesVisibility="All" 、 VerticalGridLinesBrush="Red" 和 BorderThickness="1,1,5,0"
在数据网格中。
【讨论】:
似乎没有为 GridLines 设置粗细...您可以改用 DataGridCell 属性。
<DataGrid GridLinesVisibility="Horizontal">
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0,0,3,0"/>
<Setter Property="BorderBrush" Value="Red"/>
</Style>
</DataGrid.CellStyle>
【讨论】: