Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
Selected Row Color
posted

 

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"

 

 

xmlns

="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

xmlns:x

="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

Title="Window1" Height="300" Width="300" xmlns:my="clr-namespace:Infragistics.Windows.DataPresenter;assembly=Infragistics3.Wpf.DataPresenter.v9.1" xmlns:GridSelectedItem

="clr-namespace:GridSelectedItem">

 

 

 

<Grid

>

 

 

 

<my:XamDataGrid IsSynchronizedWithCurrentItem="True" Margin="4" Name="xamDataGrid1" BindToSampleData

="True">

 

 

 

<my:XamDataGrid.FieldLayoutSettings

>

 

 

 

<my:FieldLayoutSettings HighlightAlternateRecords

="True" />

 

 

 

</my:XamDataGrid.FieldLayoutSettings

>

 

 

 

<my:XamDataGrid.FieldSettings

>

 

 

 

<my:FieldSettings CellClickAction

="SelectRecord" />

 

 

 

</my:XamDataGrid.FieldSettings

>

 

 

 

<my:XamDataGrid.Resources

>

 

 

 

<Style TargetType="{x:Type my:CellValuePresenter

}">

 

 

 

<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

>

 

 

 

</my:XamDataGrid.Resources

>

 

 

 

</my:XamDataGrid

>

 

 

 

</Grid

>

</

 

 

Window

>