Back to Devexpress

TdxCustomSpreadSheet.ActiveSheet Property

vcl-dxspreadsheetcore-dot-tdxcustomspreadsheet.md

latest2.0 KB
Original Source

TdxCustomSpreadSheet.ActiveSheet Property

Provides access to a generic worksheet object corresponding to the currently active sheet.

Declaration

delphi
property ActiveSheet: TdxSpreadSheetCustomView read; write;

Property Value

Type
TdxSpreadSheetCustomView

Remarks

You can use this property to:

  • Obtain a generic worksheet object corresponding to the active sheet within a workbook. Since a generic worksheet object does not correspond to any of the actual worksheet types, you need to cast it to the respective type to access the type-specific properties and methods;

  • Activate another sheet within a workbook by assigning its corresponding TdxSpreadSheetCustomView object.

  • Delphi

  • C++

delphi
dxSpreadSheet1.ActiveSheet := dxSpreadSheet1.Sheets[2];
cpp
dxSpreadSheet1->ActiveSheet = dxSpreadSheet1->Sheets[2];

In this example, the Sheets property, which provides zero-based indexed access to all generic sheet objects within a workbook, is used as a source of the target worksheet object.

Note

A newly created worksheet becomes active immediately.

To access the currently active Table View worksheet, use its ActiveSheetAsTable property, added as an alternative to the type casting operation.

See Also

TdxCustomSpreadSheet.ActiveSheetIndex

TdxCustomSpreadSheet Class

TdxCustomSpreadSheet Members

dxSpreadSheetCore Unit