Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF datagrid left column

Tags:

wpf

xaml

When I created a datagrid in WPF, there is a thin left column.

I don't know what is it purpose. maybe it is a status column?

How can I disable it?

like image 965
Alvin Avatar asked Oct 22 '25 12:10

Alvin


1 Answers

The "thin left column" is actually for the row header (more specifically, each row has a DataGridRowHeader which, when not filled with anything, causes the datagrid to appear like it has an extra, unnecessary column). Note: changing what appears in the row header is a whole different topic.

An example showing what row headers are

You can disable it by setting the HeadersVisibility property on the DataGrid to "Column" to show only column headers, or "None" in the case where you want no headers at all.

<DataGrid HeadersVisibility="Column" />

A similar question was asked and answered here.

like image 89
JoshuaTheMiller Avatar answered Oct 24 '25 03:10

JoshuaTheMiller