WPF DataGrid Row Header is invisible

2.1k Views Asked by At

I have WPF-MVVM DataGrid. I want to use the Row Header But it is invisible. I tried to set it with RowHeaderWidth, but it doesn't have any effect. Below is my code:

<Grid DataContext="{Binding Tours}">
  <DataGrid Grid.Row="0"
    x:Name="tourDataGrid" 
    RowHeaderWidth="27"
    ItemsSource="{Binding}" 
    AutoGenerateColumns="False"
    Height="360">

What is wrong ?

Many Thanks in advance...

1

There are 1 best solutions below

1
On BEST ANSWER

Try this:

<Grid DataContext="{Binding Tours}">
   <DataGrid Grid.Row="0"
    x:Name="tourDataGrid" 

    HeadersVisibility="All"

    RowHeaderWidth="27"
    ItemsSource="{Binding}" 
    AutoGenerateColumns="False"
    Height="360">