WPF DevExpress 中GridControl如何设置选中单元格的Style

比如要设置GridControl选中单元格的背景颜色以及字体颜色,代码如下:

<Application x:Class="XmlToDT.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" 
              xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
             StartupUri="MainWindow.xaml" Startup="OnAppStartup_UpdateThemeName">
    <Application.Resources>        

        <Style x:Key="FocusedCellStyle" TargetType="dxg:LightweightCellEditor" BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=LightweightCellStyle}}">
            <Style.Triggers>
                <Trigger Property="dxg:DataViewBase.IsFocusedCell" Value="True">
                    <Setter Property="Background" Value="MediumSeaGreen" />
                    <Setter Property="Foreground" Value="Yellow" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Application.Resources>
</Application>

 

posted @ 2017-08-28 16:47  影子张  阅读(2317)  评论(0编辑  收藏  举报