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.v20.1.Core.dll
NuGet Packages: DevExpress.WindowsDesktop.Wpf.Grid.Core, DevExpress.Wpf.Grid.Core
Declaration
Property Value
Type | Description |
---|---|
Style | The style applied to data cells. |
Remarks
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:
- In optimized mode: LightweightCellEditor
- In unoptimized mode: CellContentPresenter
<dxg:TableView>
<dxg:TableView.CellStyle>
<Style TargetType="dxg:LightweightCellEditor" />
</dxg:TableView.CellStyle>
</dxg:TableView>
The GridControl‘s CellStyle property is theme dependent. Create a new style based on the existing cell style to apply a CellStyle. For example, if you use the MetropolisDark theme, your style’s BasedOn property should be set to the following value:
<dxg:GridColumn.CellStyle>
<Style TargetType="dxg:LightweightCellEditor" BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=LightweightCellStyle, ThemeName=MetropolisDark}}"/>
</dxg:GridColumn.CellStyle>
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the CellStyle property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.