Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
Row

TableStyleElement.Clear() Method

Clears formatting for the table style element.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v21.1.Core.dll

Declaration

void Clear()

Example

The code snippet below creates a copy of a predefined table style and changes the header row color for the new style.

// Access worksheet tables.
Table table1 = worksheet.Tables[0];
Table table2 = worksheet.Tables[1];

// Return a table style you want to duplicate.
TableStyle sourceTableStyle = workbook.TableStyles[BuiltInTableStyleId.TableStyleMedium17];

// Duplicate the table style.
TableStyle newTableStyle = sourceTableStyle.Duplicate();

// Modify the new table style.
// Change background color for the header row.
newTableStyle.TableStyleElements[TableStyleElementType.HeaderRow].Fill.BackgroundColor = Color.FromArgb(0xA7, 0xEA, 0x52);

table1.Style = sourceTableStyle;
table2.Style = newTableStyle;

The image below shows the built-in TableStyleMedium17 style and its modified copy (the workbook is opened in Microsoft® Excel®).

Custom Spreadsheet Table Style

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Clear() method.

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.

See Also