Styling a WPF layout grid background (of each cell, row, column)

前端 未结 5 2017
忘掉有多难
忘掉有多难 2021-01-30 11:07

I would like to know if there is any way to style a WPF layout grid\'s cells, rows and columns. I\'ve been trying to find any information and the few mentions I\'ve found have n

5条回答
  •  执念已碎
    2021-01-30 12:10

    The WPF Grid doesn't have visible cells as such. Think of them as invisible grid lines against which you can have child elements be aligned.

    So, to style the grid's cells, you have to style the items that are aligned inside the grid.

    It is confusing to think of the Grid as being anything like a WinForms DataGrid. I guess its closest WinForms equivalent is the TableLayout control.

    Check out some 3rd party grid controls. I used the DevExpress one while it was in beta and found it pretty straightforward.

提交回复
热议问题