WPF数据网格垂直线条厚度

4
我已经在我的 WPF 窗口中添加了一个 DataGrid,并在 XAML 中设置了 VerticalGridLinesBrush 属性以显示相关颜色的垂直网格线。但是,我无法弄清楚如何增加在 DataGridRow 中显示的垂直网格线的宽度。
有人能告诉我如何在 WPF DataGrid 中设置垂直网格线的宽度吗?
2个回答

5

设置以下属性:

GridLinesVisibility="All",VerticalGridLinesBrush="Red" 和 BorderThickness="1,1,5,0"

在数据表格中。


2

似乎没有网格线的厚度设置...你可以使用 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>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接