0

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

user342319
  • 1
  • 1
  • 3

1 Answers1

1

Try this:

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

    HeadersVisibility="All"

    RowHeaderWidth="27"
    ItemsSource="{Binding}" 
    AutoGenerateColumns="False"
    Height="360">
Andres
  • 34
  • 8
  • Thanks, It works. My mistake was that I didn't see the row header in VS designer, and I thought that also during runtime it would not exist. – user342319 Jan 08 '18 at 06:08