tags:

views:

307

answers:

2

I'm using the WPF DataGrid control to show some details and a select button, and I don't need the grey selector column down the left hand side. It's also ruining the beauty of my design ;)

Is there a way to remove it, or how can I style it to match if not?

+1  A: 

Use the RowHeaderWidth property:

<my:DataGrid RowHeaderWidth="0" AutoGenerateColumns="False" Name="dataGrid1" />

Note that you can also specify a style or template for it also, should you decide you really do like it and want to keep it because you can do something cool with it.

slugster
for some reason, I couldn't find that anywhere. Feel a bit "doh!" now, but thank you.
Tim Almond
A: 

Had the same problem.

Looks like the RowHeaderWidth is not supported in XAML BUT you can specify in the code behind right after the bind and it takes out that crappy selector column.

grdName.RowHeaderWidth = 0

Frank Kotulak