The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+
Row

Table.Style Property

Gets or sets the style applied to the table.

Namespace: DevExpress.Spreadsheet

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

Declaration

TableStyle Style { get; set; }
Property Style As TableStyle
TableStyle Style { get; set; }
Property Style As TableStyle
TableStyle Style { get; set; }
Property Style As TableStyle

Property Value

Type Description
TableStyle

A TableStyle object that specifies the table style.

Property Value

Type Description
TableStyle

A TableStyle object that specifies the table style.

Property Value

Type Description
TableStyle

A TableStyle object that specifies the table style.

Remarks

When you create a new table, the default table style (TableStyleCollection.DefaultStyle) is automatically applied to the created table. Use the Style property to format a table with any style from the TableStyleCollection collection. By default, the style collection contains a set of built-in styles similar to Microsoft Excel and the None style, which specifies clear table formatting. Built-in styles are defined with the BuiltInTableStyleId enumeration.

Examples

The following code applies the BuiltInTableStyleId.TableStyleDark9 built-in style to a Table in a worksheet.

Note

A complete sample project is available at https://github.com/DevExpress-Examples/how-to-format-tables-e4909

spreadsheetControl1.BeginUpdate()
' Access the workbook's collection of table styles.
Dim tableStyles As TableStyleCollection = spreadsheetControl1.Document.TableStyles
' Access the built-in table style from the collection by its Id.
Dim tableStyle As TableStyle = tableStyles(BuiltInTableStyleId.TableStyleDark9)

' Apply the table style to the existing table.
Dim myTable As Table = spreadsheetControl1.ActiveWorksheet.Tables(0)
myTable.Style = tableStyle

' Show header and total rows.
myTable.ShowHeaders = True
myTable.ShowTotals = True
' Apply banded column formatting to the table.
myTable.ShowTableStyleRowStripes = False
myTable.ShowTableStyleColumnStripes = True

spreadsheetControl1.EndUpdate()
See Also