比如要设置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>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-07-01
  • 2021-10-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-08
  • 2021-09-05
  • 2022-12-23
相关资源
相似解决方案