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>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM