Skip to main content
Row

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TableStyleElement.Clear() Method

In This Article

Clears formatting for the table style element.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

#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.

View Example: Create and Format Spreadsheet Tables

// 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

See Also