Back to Devexpress

TableStyleCollection.DefaultStyle Property

officefileapi-devexpress-dot-spreadsheet-dot-tablestylecollection.md

latest3.0 KB
Original Source

TableStyleCollection.DefaultStyle Property

Specifies the default table style.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
TableStyle DefaultStyle { get; set; }
vb
Property DefaultStyle As TableStyle

Property Value

TypeDescription
TableStyle

A TableStyle object.

|

Remarks

If the default table style is not explicitly specified, the DefaultStyle property returns the None table style. This is the built-in table style that specifies no formatting for a table. This style is applied to a table to clear its formatting and serves as the base when a new style is created by the TableStyleCollection.Add method. The image below shows the table appearance when the None table style is applied.

You can set the DefaultStyle property to any table style contained in the collection.

Example

This example demonstrates how to specify the default table style. This style is used in the following cases:

csharp
void ChangeDefaultTableStyle(IWorkbook workbook, string styleName) {
    // Set the default style for tables in the document.
    workbook.TableStyles.DefaultStyle = workbook.TableStyles[styleName];
}
vb
Private Sub ChangeDefaultTableStyle(ByVal workbook As IWorkbook, ByVal styleName As String)
    ' Set the default style for tables in the document.
    workbook.TableStyles.DefaultStyle = workbook.TableStyles(styleName)
End Sub

See Also

Spreadsheet Tables

TableStyleCollection Interface

TableStyleCollection Members

DevExpress.Spreadsheet Namespace