Hi
I'm having trouble trying to modify the Selected Background color on the WPF Grid. I've followed the examples and still having no luck.I've attached a sample which "should" change the default selected row color, but it doesn't...
Any help would be most appreciated.
Thanks
M
<
Window x:Class
="GridSelectedItem.Window1"
="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
="http://schemas.microsoft.com/winfx/2006/xaml"
="clr-namespace:GridSelectedItem">
>
="True">
="True" />
="SelectRecord" />
}">
="BackgroundSelected">
="0,1">
="Violet"/>
="Red"/>
</
You have to change the style to target the DataRecordCellArea instead of the CellValuePresenter since you are setting CellClickAction to SelectRecord. The following style should works correctly:
<Style TargetType="{x:Type my:DataRecordCellArea }"> <Setter Property ="BackgroundSelected"> <Setter.Value> <LinearGradientBrush StartPoint="0,0" EndPoint ="0,1"> <GradientStop Offset="0" Color ="Violet"/> <GradientStop Offset="1.1" Color ="Red"/> </LinearGradientBrush> </Setter.Value> </Setter></Style>
Regards
Vlad
Works perfectly... Thanks loads.!!