Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxSpreadSheetTableViewOptions.DefaultColumnWidth Property

Specifies the default column width in a Table View worksheet.

#Declaration

Delphi
property DefaultColumnWidth: Integer read; write;

#Property Value

Type
Integer

#Remarks

Use the DefaultColumnWidth and DefaultRowHeight properties to change the default cell dimensions in a worksheet. These property values correspond to a cell size in pixels only if the worksheet’s Options.ZoomFactor property is set to 100 (real size).

The worksheet’s look and feel corresponding to the default DefaultColumnWidth property value is displayed below:

The following code example sets custom column widths for two worksheets in the current spreadsheet document:

//...
// Cast the objects returned by the control's Sheets property to the TdxSpreadSheetTableView class to access the DefaultColumnWidth property.
  TdxSpreadSheetTableView(dxSpreadSheet1.Sheets[0]).Options.DefaultColumnWidth := 50;
  TdxSpreadSheetTableView(dxSpreadSheet1.Sheets[1]).Options.DefaultColumnWidth := 100;

The DefaultColumnWidth property automatically updates by multiplying its current value by the form’s scaling factor every time it changes.

The default value of the DefaultColumnWidth property is dxSpreadSheetDefaultColumnWidth.

See Also