All docs
V20.1
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

GridControl.CustomCellAppearance Event

Allows you to customize cell appearance.

Namespace: DevExpress.UI.Xaml.Grid

Assembly: DevExpress.UI.Xaml.Grid.v20.1.dll

Declaration

public event EventHandler<CustomCellAppearanceEventArgs> CustomCellAppearance
Public Event CustomCellAppearance As EventHandler(Of CustomCellAppearanceEventArgs)

Event Data

The CustomCellAppearance event's data class is CustomCellAppearanceEventArgs. The following properties provide information specific to this event:

Property Description
CellConditionalFormat Gets the conditional format applied to the cell.
CellControl Provides access to the object used to visualize the cell.
Column Gets the cell's column
IsCellSelected Indicates whether the cell is selected.
IsRowSelected Indicates whether the row is selected.
ResultFormat Provides access to the appearance settings applied to the cell.
RowConditionalFormat Gets the conditional format applied to the row.
RowHandle Gets the handle of the cell's row.

Remarks

The event's ResultFormat property provides access to the appearance settings.

You can use the CustomCellAppearance event to override conditional formatting. The event's CellConditionalFormat and RowConditionalFormat properties return the appearance settings defined by the conditional formatting rules.

See the example below.

 void CustomCellAppearance(object sender, CustomCellAppearanceEventArgs e) {  
    e.ResultFormat.Foreground = e.CellConditionalFormat?.Foreground ?? e.RowConditionalFormat?.Foreground ?? e.ResultFormat.Foreground;  
 }
See Also