In MS ListView I did like this to set color/brush on a row with sertial "Category" value.
In Listview
How can I applay the same method on RadGridView?
| <Window.Resources> |
| <Style x:Key="ItemContStyle" TargetType="{x:Type ListViewItem}"> |
| <Style.Resources> |
| <LinearGradientBrush x:Key="Brush1" StartPoint="0.5,0" EndPoint="0.5,1"> |
| <GradientStop Offset="0.1" Color="#AA00CC00" /> |
| <GradientStop Offset="0.8" Color="#55008800" /> |
| </LinearGradientBrush> |
| <LinearGradientBrush x:Key="Brush2" StartPoint="0.5,0" EndPoint="0.5,1"> |
| <GradientStop Offset="0.1" Color="Orange" /> |
| <GradientStop Offset="0.8" Color="OrangeRed" /> |
| </LinearGradientBrush> |
| </Style.Resources> |
| <Style.Triggers> |
| <DataTrigger Binding="{Binding Path=Category}" Value="1"> |
| <Setter Property="Background" Value="{StaticResource Brush1}" /> |
| <Setter Property="Height" Value="25"/> |
| </DataTrigger> |
| <DataTrigger Binding="{Binding Path=Category}" Value="2"> |
| <Setter Property="Background" Value="{StaticResource Brush2}" /> |
| <Setter Property="Height" Value="30"/> |
| </DataTrigger> |
| </Style.Triggers> |
| </Style> |
| </Window.Resources> |
In Listview
| <ListView x:Name="listView1" ItemContainerStyle="{StaticResource ItemContStyle}"> |
| <ListView.View> |
| <GridView> |
| <GridViewColumn Header="Artist" DisplayMemberBinding="{Binding Path=Artist}" Width="310" /> |
| <GridViewColumn Header="Title" DisplayMemberBinding="{Binding Path=Title}" Width="310" /> |
| </GridView> |
| </ListView.View> |
| </ListView> |
How can I applay the same method on RadGridView?