Back to Devexpress

TableCellPropertiesBase.CellBackgroundColor Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-tablecellpropertiesbase.md

latest6.3 KB
Original Source

TableCellPropertiesBase.CellBackgroundColor Property

Gets or sets the TableCell.BackgroundColor property for the specified cells.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
Color? CellBackgroundColor { get; set; }
vb
Property CellBackgroundColor As Color?

Property Value

TypeDescription
Nullable<Color>

A Color value or null if the color is not set or is not the same for the specified cells.

|

Remarks

Important

The semi-transparent alpha component (i.e. the Color’s alpha parameter set to value less than 255) is reset to opaque (255) during export to all formats except PDF.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CellBackgroundColor 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.

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Table.cs#L124

csharp
tStyleMain.TableBorders.Right.LineStyle = BorderLineStyle.Double;
tStyleMain.CellBackgroundColor = System.Drawing.Color.LightBlue;
tStyleMain.TableLayout = TableLayoutType.Fixed;

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/TableActions.cs#L92

csharp
tStyleMain.TableBorders.Right.LineStyle = BorderLineStyle.Double;
tStyleMain.CellBackgroundColor = System.Drawing.Color.LightBlue;
tStyleMain.TableLayout = TableLayoutType.Fixed;

winforms-richedit-tables-simple-example/CS/TablesSimpleExample/Form1.cs#L210

csharp
insideVerticalBorder.LineColor = Color.White;
tStyleMain.CellBackgroundColor = Color.FromArgb(227, 238, 220);
tStyleMain.Name = "MyTableStyle";

word-document-api-table-examples/CS/Program.cs#L196

csharp
tStyleMain.TableBorders.InsideVerticalBorder.LineColor = Color.White;
tStyleMain.CellBackgroundColor = Color.FromArgb(227, 238, 220);
tStyleMain.Name = "MyTableStyle";

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Table.vb#L112

vb
tStyleMain.TableBorders.Right.LineStyle = DevExpress.XtraRichEdit.API.Native.BorderLineStyle.[Double]
tStyleMain.CellBackgroundColor = System.Drawing.Color.LightBlue
tStyleMain.TableLayout = DevExpress.XtraRichEdit.API.Native.TableLayoutType.Fixed

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/TableActions.vb#L82

vb
tStyleMain.TableBorders.Right.LineStyle = BorderLineStyle.Double
tStyleMain.CellBackgroundColor = System.Drawing.Color.LightBlue
tStyleMain.TableLayout = TableLayoutType.Fixed

word-document-api-examples/VB/CodeExamples/TablesActions.vb#L198

vb
Dim myNewStyleForFirstRow As DevExpress.XtraRichEdit.API.Native.TableConditionalStyle = myNewStyle.ConditionalStyleProperties.CreateConditionalStyle(DevExpress.XtraRichEdit.API.Native.ConditionalTableStyleFormattingTypes.FirstRow)
myNewStyleForFirstRow.CellBackgroundColor = System.Drawing.Color.PaleVioletRed
Dim myNewStyleForFirstColumn As DevExpress.XtraRichEdit.API.Native.TableConditionalStyle = myNewStyle.ConditionalStyleProperties.CreateConditionalStyle(DevExpress.XtraRichEdit.API.Native.ConditionalTableStyleFormattingTypes.FirstColumn)

winforms-richedit-tables-simple-example/VB/TablesSimpleExample/Form1.vb#L173

vb
insideVerticalBorder.LineColor = Color.White
tStyleMain.CellBackgroundColor = Color.FromArgb(227, 238, 220)
tStyleMain.Name = "MyTableStyle"

word-document-api-table-examples/VB/Program.vb#L158

vb
tStyleMain.TableBorders.InsideVerticalBorder.LineColor = Color.White
tStyleMain.CellBackgroundColor = Color.FromArgb(227, 238, 220)
tStyleMain.Name = "MyTableStyle"

See Also

TableCellPropertiesBase Interface

TableCellPropertiesBase Members

DevExpress.XtraRichEdit.API.Native Namespace