Search code examples
.netwpfxamldatagrid

Coloring Gridlines in WPF Datagrid


How can I set the color of the gridlines of a wpf datagrid? I can hide these lines with the property GridLinesVisibility, but I don't know how to color them. I tried it with the Borderbrush of rows and cells but I didn't succeed.


Solution

  • You have the Properties HorizontalGridLinesBrush and VerticalGridLinesBrush

    Example

    <DataGrid HorizontalGridLinesBrush="Green"
              VerticalGridLinesBrush="Red"
              ...>