DAutoSizeCols Property
Applies To
fpSpread control
Description
Sets or returns whether a bound sheet automatically sizes its columns based on the data in the associated database fields.
Syntax
long CSpreadSheet::GetDAutoSizeCols( );
void CSpreadSheet::SetDAutoSizeCols(long value);
[form.]fpSpread.DAutoSizeCols[ = setting%]
Remarks
The following settings are available:
Setting | Description | Constant |
---|---|---|
0 - Off | Does not automatically resize columns | DAutoSizeColsNone |
1 - Max Col Width | Sets column width to the largest string size | DAutoSizeColsMax |
2 - Best Guess | (Default) Sets column width based on the data type for that field | DAutoSizeColsBest |
This setting is applied to the entire workbook, including all sheets in the control.
When you set the DAutoSizeCols property to 2 (Best Guess), the sheet chooses a size (hard-coded in the Spread software) based on the data type. The actual data might be larger or smaller than the chosen width.
The sheet can also automatically determine the cell types for cells in bound columns, automatically fill the sheet from the bound database, and automatically set the text in the column headers, depending on the settings of the DAutoCellTypes, DAutoFill, and DAutoHeadings properties.
This property is valid only when the sheet is bound to a database.
Spread Designer
Choose the Sheet menu, and then the Data Binding menu, and then select an item in the Size Column To Data drop-down list box in the Data Binding Settings dialog box.
Data Type
Integer (Enumerated)
See Also
Sizing Columns in Bound Sheets
DAutoCellTypes, DAutoFill, DAutoHeadings properties