I'm stumbled on this ridiculous problem for a few days now, and would appreciate any bits of wisdom any one has on the matter.
I'm trying to implement a DataGrid with multiple row selection that will set the last selected row (focused row if i may, tho it appears to not be supported by the DataGrid object) to have a different background from the other selected rows and draw a border around it.
I need a virtualizing control, so a ListView is not a viable solution as far as i know.
How would one go about it in WPF? I managed so far only disable the cell selection rectangle...
Thanks in advance!
Edit: In order to further clarify what i'm trying to do i post my latest failed attemp..:
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True"/>
<Condition Property="IsFocused" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="#FF3399FF"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="Black"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True"/>
<Condition Property="IsFocused" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="#993399FF"/>
</MultiTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
This would work nice if only the row will somehow get focus....
I do wonder why is the IsFocused property even there if DataGridRow don't receive focus?