WPF DataGrid provides a HeadersVisibility property to hide Row Headers and Column Headers.
HeaderVisibility possible values are:
- All – Both row and column headers are visible.
- Row – Only row headers are visible and column headers are hidden.
- Column – Only column headers are visible and row headers are hidden.
- None – Both row and column headers are hidden.
HeadersVisibility – All
<DataGrid x:Name="myDataGrid" HeadersVisibility="All">
</DataGrid>
HeadersVisibility – Row
<DataGrid x:Name="myDataGrid" HeadersVisibility="Row">
</DataGrid>
HeadersVisibility – Column
<DataGrid x:Name="myDataGrid" HeadersVisibility="Column">
</DataGrid>
HeadersVisibility – None
<DataGrid x:Name="myDataGrid" HeadersVisibility="None">
</DataGrid>