0

I have following grid. I have to hide column border of the grid and change the color of the row border. How to do that in WPF?enter image description here

Also I have to make padding between the cells contents.

4

2 回答 2

1

网格线非常简单:使用 DataGrid 的 Horizo​​ntalGridLinesBrush 和 VerticalGridLinesBrush 属性。对于红色水平线和透明垂直线:

    <DataGrid HorizontalGridLinesBrush="Red" VerticalGridLinesBrush="Transparent"/>

填充不是那么明显:检查https://stackoverflow.com/a/5247078/786055

于 2013-05-20T12:50:15.623 回答
0

你必须设置GridLinesVisibility="None"

<DataGrid GridLinesVisibility="None">
    ...
<DataGrid>
于 2013-05-20T13:01:07.640 回答