ListObject::DataBoundFormatSettings Property
Gets or sets which FormatSettings of the specified XlRangeAutoFormat are applied to the ListObject control.
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
property FormatSettings DataBoundFormatSettings { FormatSettings get(); void set(FormatSettings value); }
Property Value
Type: Microsoft.Office.Tools.Excel::FormatSettingsA bitwise combination of the FormatSettings values.
By default, all of the information in the XlRangeAutoFormat style is applied. However, specific items can be removed so that the style is not applied to those items. These items are:
Number
Font
Alignment
Border
Pattern
Width
To apply only selected styles, set DataBoundFormatSettings before the DataBoundFormat property is set. DataBoundFormatSettings will not work if DataBoundFormat is already set.
The following code example creates a DataTable and a ListObject, and binds the ListObject to the DataTable. It then sets the FormatSettings to apply to the ListObject and uses an XlRangeAutoFormat value to supply the format.
This example is for a document-level customization.