Search code examples
wpfwpfdatagrid

How Do I Hide wpf datagrid row selector


I'm using the WPF DataGrid control to show some details and a select button, and I don't need the gray 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?


Solution

  • 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.