[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Views
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Grouping
   [Expand]Filtering and Searching
   [Expand]Sorting
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus, Navigation, Selection
   [Expand]Drag-and-Drop
   [Collapse]Conditional Formatting
    [Collapse]Conditional Formats
      Formatting Values Using Comparison Rules
      Formatting Date-Time Values
      Formatting Unique and Duplicate Values
      Formatting Top and Bottom Values
      Formatting Above or Below Average Values
      Formatting Changing Values
      Formatting Values Using Icon Sets
      Formatting Values Using Color Scales
      Formatting Values Using Data Bars
      Formatting Values Using Custom Conditions
      Formatting Focused Cells and Rows
    [Expand]Creating Conditional Formatting Rules
     Examples
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]Miscellaneous
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Formatting Focused Cells and Rows

By default, when a user focuses a cell or row, the standard background color overrides the color specified by conditional formatting.

The GridControl allows you to customize the color of a focused cell or row that has conditional formatting applied. You can either provide a specific value or choose a color based on a custom logic using the CustomRowAppearance event. Depending on the grid's view type, you can either use the TableView.CustomRowAppearance or TreeListView.CustomRowAppearance events.

In the following code sample, the row background color is modified by the ShadeBrush() method. The color is calculated based on the value defined by conditional formatting.

The image below illustrates the result.

To control the background color of individual focused cells that have conditional formatting applied, handle the TableView.CustomCellAppearance or TreeListView.CustomCellAppearance events in a similar way.

Expanded See Also

Is this topic helpful?​​​​​​​