1、GridLinesVisibility = “全部”,VerticalGridLinesBrush = “红” 与了borderThickness = “1,1,5,0”
在dataGrid中设置这些属性,只能改变线的颜色,及表格的四边粗细,没办法设置线的宽度。
2、GridLines似乎没有宽度设置…您可以使用DataGridCell属性代替。
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0,0,3,0"/>
<Setter Property="BorderBrush" Value="Red"/>
</Style>
</DataGrid.CellStyle>
该博客讨论了在WPF中的DataGrid控件中如何设置网格线颜色和表格边框的厚度。尽管可以改变线条颜色和边框粗细,但无法直接设置网格线的宽度。作者建议使用DataGridCell的样式来间接实现类似效果,通过调整Cell的边框厚度和颜色来定制视觉样式。
1774

被折叠的 条评论
为什么被折叠?



