A newer version of this page is available. Switch to the current version.

DataViewBase.CellStyle Property

Gets or sets the style applied to data cells displayed within a View. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v19.1.Core.dll


public Style CellStyle { get; set; }
Public Property CellStyle As Style

Property Value

Type Description

A Style object that represents the style applied to data cells.


The CellStyle property specifies the style that groups together properties, resources, and event handlers and shares them between instances of the LightweightCellEditor type.

Target Type:

See the example below.

        <Style TargetType="dxg:LightweightCellEditor" BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=LightweightCellStyle}}" />

The GridControl's CellStyle property is theme dependent. Create a new style based on the existing cell style to apply a CellStyle. E.g., if you are using the MetropolisDark theme, your style's BasedOn property should be set to the following value:

    <Style TargetType="dxg:LightweightCellEditor" BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=LightweightCellStyle, ThemeName=MetropolisDark}}"/>

Starting from v18.2, you can add the CellStyle without specifying the style's BasedOn property.

See Also