Skip to main content

ColumnBase.CellStyleSettings Property

Gets or sets style settings applied to a column’s cells.

Namespace: DevExpress.WinUI.Grid

Assembly: DevExpress.WinUI.Grid.v23.2.dll

NuGet Package: DevExpress.WinUI

Declaration

[DP(null, Handler = "OnCellStyleSettingsChanged")]
public CellStyleSettings CellStyleSettings { get; set; }

Property Value

Type Description
CellStyleSettings

Style settings applied to a column’s cells.

Remarks

CellStyleSettings include the following properties:

Property Description
Background Gets or sets a brush that paints a cell’s background.
FocusedBackground Gets or sets a brush that paints the focused cell’s background.
FocusedForeground Gets or sets a brush that paints the focused cell’s foreground.
FocusedSelectedBackground Gets or sets a brush that paints a cell’s background when this cell is focused and selected at the same time.
FocusedSelectedForeground Gets or sets a brush that paints a cell’s foreground when this cell is focused and selected at the same time.
FontFamily Gets or sets a cell’s font family.
FontSize Gets or sets a cell’s font size.
FontStretch Gets or sets a cell’s font stretch.
FontStyle Gets or sets a cell’s font style.
FontWeight Gets or sets a cell’s font weight.
Foreground Gets or sets a brush that paints a row’s foreground.
Padding Gets or sets the space between the cell’s borders and its contents.
SelectedBackground Gets or sets a brush that paints the selected cell’s background.
SelectedForeground Gets or sets a brush that paints the selected cell’s foreground.
ValidationCriticalImage Gets or sets a cell validation image for which ErrorType is Critical.
ValidationInformationImage Gets or sets a cell validation image for which ErrorType is Information.
ValidationWarningImage Gets or sets a cell validation image for which ErrorType is Warning.

Example

WinUI Data Grid - Customize Cells

<dxg:GridControl ItemsSource="{x:Bind ViewModel.Source}" 
                 AutoGenerateColumns="False" 
                 NavigationStyle="Cell" 
                 SelectionMode="CellExtended">
    <dxg:GridControl.Columns>
        <dxg:GridTextColumn FieldName="ProductName">
            <dxg:GridTextColumn.CellStyleSettings>
                <dxg:CellStyleSettings FocusedSelectedBackground="Black" 
                                       FocusedSelectedForeground="Orange" 
                                       Foreground="Red" 
                                       SelectedBackground="Blue" 
                                       SelectedForeground="LightBlue"/>
            </dxg:GridTextColumn.CellStyleSettings>
        </dxg:GridTextColumn>
        <!-- ... -->
    </dxg:GridControl.Columns>
</dxg:GridControl>
See Also