I have a DataGrid with RowHeaders. These RowHeaders are displayed in, what I would call the first column of the grid. All the "data" columns have a header with the name of the column in it. The "first column" that contains the row header does not have such a "header". Is it possible to capture click events on that "header"? To make clear what "header" I mean, here an image:
EDIT:
This is my DataGrid definition including the code from @EldHasp answer
<DataGrid Name="TenantsGrid"
Style="{StaticResource DataGridStyle}"
d:ItemsSource="{Binding TenantGridDataSource}"
AutoGenerateColumns="False"
CanUserResizeRows="False"
SelectionMode="Single"
IsReadOnly="True"
SelectedItem="{Binding SelectedTenant}" Margin="10,0,11,10">
<FrameworkElement.Resources>
<Style x:Key="{ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}"
TargetType="{x:Type Button}"
BasedOn="{StaticResource {ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}}">
<EventSetter Event="Click" Handler="OnClickSelectAll"/>
</Style>
</FrameworkElement.Resources>
<DataGrid.Columns>
<DataGridTextColumn Header="Nachname" Width="Auto" Binding="{Binding LastName}" CanUserSort="True"/>
<DataGridTextColumn Header="Vorname" Width="Auto" Binding="{Binding FirstName}" CanUserSort="True"/>
<DataGridTextColumn Header="eMail" Width="Auto" Binding="{Binding EMail}" CanUserSort="False"/>
<DataGridTextColumn Header="Telefon" Width="Auto" Binding="{Binding PhoneNumber}" CanUserSort="False"/>
<DataGridTextColumn Header="Notizen" Width="*" Binding="{Binding Notes}" CanUserSort="False"/>
<DataGridCheckBoxColumn Width="Auto" Binding="{Binding Flagged}" CanUserSort="False">
<DataGridCheckBoxColumn.Header>
<TextBlock Text="M" ToolTip="Markiert - Auf Notizen achten!" />
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
<DataGridCheckBoxColumn Width="Auto" Binding="{Binding Blocked}" CanUserSort="False">
<DataGridCheckBoxColumn.Header>
<TextBlock Text="B" ToolTip="Blockiert - Keine weitere Buchung annehmen!" />
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
</DataGrid.Columns>
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<EventSetter Event="Click" Handler="OnColumnHeaderClicked"/>
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<DataTrigger Binding="{Binding Flagged}" Value="True">
<Setter Property="Background" Value="#F1F5E4"/>
</DataTrigger>
<DataTrigger Binding="{Binding Blocked}" Value="True">
<Setter Property="Background" Value="#DDD5C3"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
</DataGrid>
DataGridStyle is:
<Style x:Key="DataGridStyle" TargetType="DataGrid">
<Setter Property="RowHeaderStyle" Value="{DynamicResource GridRowHeaderStyle}"/>
</Style>
<Style x:Key="GridRowHeaderStyle" TargetType="DataGridRowHeader">
<Setter Property="Width" Value="20"/>
<Style.Triggers>
<Trigger Property="IsRowSelected" Value="True">
<Setter Property="FontFamily" Value="Segoe UI"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Foreground" Value="Gray"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="5 0"/>
<Setter Property="Content" Value="●"/>
</Trigger>
</Style.Triggers>
</Style>
