.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+
Row

TableStyleCollection.DefaultStyle Property

Gets or sets the default table style.

Namespace: DevExpress.Spreadsheet

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

Declaration

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

Property Value

Type Description
TableStyle

A TableStyle object.

Property Value

Type Description
TableStyle

A TableStyle object.

Property Value

Type Description
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.

SpreadsheetControl_NoneTableStyle

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

Examples

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

  • If you create a table and do not explicitly specify a style to be applied to this table, the default style will be automatically applied to the created table.
  • If you remove a table style that has been previously applied to a table, the table style will be changed to the default style.
Note

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

Private Sub ChangeDefaultTableStyle(ByVal workbook As IWorkbook, ByVal styleName As String)
    ' Set the style to be applied to created tables by default.
    workbook.TableStyles.DefaultStyle = workbook.TableStyles(styleName)
End Sub
See Also