how did set gridcontrol rowstyle in silverlight?

我想改变gridcontrol默认的行颜色,不成功。部分代码如下:

        <dxg:GridControl x:Name="_gridControl"  AutoPopulateColumns="False"  ColumnsPopulated="_gridControl_ColumnsPopulated"  Height="150" >
            <dxg:GridControl.View>
                <dxg:TableView x:Name="_tableView" AllowSorting="False" ShowGroupPanel="False"  AutoWidth="true" NewItemRowPosition="Bottom"  RowIndicatorContentTemplate="{StaticResource rowIndicatorContentTemplate}">
                    <dxg:TableView.RowStyle>
                        <Style TargetType="dxg:GridRowContent">  
                            <Setter Property="Background" Value="Red" />
                            <Setter Property="Foreground" Value="Red" />
                        </Style>
                    </dxg:TableView.RowStyle>

参考Silverlight DevExpress之GridControl+TableView实现隔行换色
先在配置文件和窗口界面设置好,然后在后台代码中添加代码

    #region 隔行换色
    public class SelectionStateToBrushConverter : IValueConverter
    {
        public SolidColorBrush NormalBrush { get; set; }
        public SolidColorBrush AlternateBrush { get; set; }

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool IsAlterRow = (bool)value;
            if (IsAlterRow)
                return AlternateBrush;
            return NormalBrush;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
    #endregion

谢谢。我上边的样式不起作用。我的目的是改变焦点行的背景色和文字颜色。官方给的文字颜色是白色,看不清楚内容。交替换行颜色用这个可以:__tableView.AlternateRowBackground = new SolidColorBrush(Colors.Red);_