Alvin
Alvin

Reputation: 8499

WPF datagrid left column

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?

Upvotes: 4

Views: 3794

Answers (1)

JoshuaTheMiller
JoshuaTheMiller

Reputation: 3049

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.

Upvotes: 5

Related Questions