Back to Devexpress

TableCell.BackgroundColor Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-tablecell-be070d14.md

latest5.7 KB
Original Source

TableCell.BackgroundColor Property

Gets or sets the color of the cell background.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
Color BackgroundColor { get; set; }
vb
Property BackgroundColor As Color

Property Value

TypeDescription
Color

A Color that is the color of the background.

|

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 BackgroundColor 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-tables-simple-example/CS/TablesSimpleExample/Form1.cs#L184

csharp
table[i, j].Borders.Top.LineStyle = BorderLineStyle.None;
    table[i, j].BackgroundColor = Color.Transparent;
}

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

csharp
TableRow targetRow = table.Rows[2];
targetRow.Cells[0].BackgroundColor = Color.FromArgb(99, 122, 110);
targetRow.Cells[1].BackgroundColor = Color.FromArgb(99, 122, 110);

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

csharp
{
    cell.BackgroundColor = System.Drawing.Color.Yellow;
}

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

csharp
{
    row[2].BackgroundColor = System.Drawing.Color.LightCyan;
    row[2].VerticalAlignment = TableCellVerticalAlignment.Center;

word-document-api-examples/CS/CodeExamples/TablesActions.cs#L130

csharp
{
    cell.BackgroundColor = Color.Yellow;
    cell.Borders.Bottom.LineColor = Color.Red;

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

vb
table(i, j).Borders.Top.LineStyle = BorderLineStyle.None
    table(i, j).BackgroundColor = Color.Transparent
Next

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

vb
Dim targetRow As TableRow = table.Rows(2)
targetRow.Cells(0).BackgroundColor = Color.FromArgb(99, 122, 110)
targetRow.Cells(1).BackgroundColor = Color.FromArgb(99, 122, 110)

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

vb
Public Shared Sub ChangeCellColor(ByVal cell As DevExpress.XtraRichEdit.API.Native.TableCell, ByVal i As Integer, ByVal j As Integer)
    cell.BackgroundColor = System.Drawing.Color.Yellow
End Sub

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

vb
Public Shared Sub ChangeColumnColor(ByVal row As TableRow, ByVal rowIndex As Integer)
    row(2).BackgroundColor = System.Drawing.Color.LightCyan
    row(2).VerticalAlignment = TableCellVerticalAlignment.Center

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

vb
Sub(cell As TableCell, i As Integer, j As Integer)
    cell.BackgroundColor = Color.Yellow
    cell.Borders.Bottom.LineColor = Color.Red

See Also

TableCell Interface

TableCell Members

DevExpress.XtraRichEdit.API.Native Namespace