I have overriden the default row header style to use my custom button:
<Style x:Key="RowHeaderStyle" TargetType="DataGridRowHeader">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridRowHeader">
<Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Style="{StaticResource RowHeaderButton}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
The problem of course is that clicking the button no longer selects the row. Will I have to call a custom method on the IsPressed event? How would I know the row index? How would you go about doing it?
Thanks!
I’ve ended up using only styling which turns out you can probably do what you want if it isn’t drastic. If anyone manages to get the code behind to handle row selection on DataGridHeaderBorder please let me know!
Example: