I've been trying to change the row background color in radgridview based on a condition in RowLoaded event handler
[code]
if(myCondition)
{
var row = e.Row;
Style style = new Style(typeof(GridViewRow));
style.BasedOn = e.Row.Style;
style.Setters.Add(new Setter(GridViewRow.BackgroundProperty, new SolidColorBrush(Colors.Orange)));
style.Setters.Add(new Setter(GridViewRow.ForegroundProperty, new SolidColorBrush(Colors.Green)));
}
[/code]
The Foreground color is set correctly but nothing happens to the Background color. Am I missing something?
[code]
if(myCondition)
{
var row = e.Row;
Style style = new Style(typeof(GridViewRow));
style.BasedOn = e.Row.Style;
style.Setters.Add(new Setter(GridViewRow.BackgroundProperty, new SolidColorBrush(Colors.Orange)));
style.Setters.Add(new Setter(GridViewRow.ForegroundProperty, new SolidColorBrush(Colors.Green)));
}
[/code]
The Foreground color is set correctly but nothing happens to the Background color. Am I missing something?