Microsoft’s WPF datagrid has a lot of properties and styles you can tweak to get it looking right (if you are a designer).
Below, find my cheat sheet to styling the grid. It is not 100% comprehensive but it gets you far and has a few very useful tips & gotchas.
At the highest level in the DataGrid , you can change the look & feel by setting some of these:
Property | Type | Values | Default |
AlternatingRowBackground | Brush | Any Brush | Null |
Background | Brush | Any Brush | Theme default |
ColumnHeaderHeight | Double | 0 to any positive double | NaN |
ColumnHeaderStyle | Style | Any Style | Null |
ColumnWidth | DataGridLength | 0 to any positive double, Auto, *, SizeToCells, SizeToHeader | SizeToHeader |
HeadersVisibility | DataGridHeadersVisibility | All, Row, Column, None | All |
MaxColumnWidth | Double | 0 to any positive double | Positive Infinity |
MaxRowHeight | Double | 0 to any positive double | Positive Infinity |
MinColumnWidth | Double | 0 to any positive double | 20 |
MinRowHeight | Double | 0 to any positive double | 0 |
RowBackground | Brush | Any Brush | Theme default |
RowDetailsVisibilityMode | DataGridRowDetailsVisibilityMode | Visible, VisibleWhenSelected, Collapsed | VisibleWhenSelected |
RowHeadersWidth | Double | 0 to any positive double | NaN |
RowHeight | Double | 0 to any positive double | NaN |