wpf-devexpress-dot-xpf-dot-spreadsheet-dot-spreadsheetcontrol-d51dae67.md
Gets the worksheet that is currently displayed in the SpreadsheetControl.
Namespace : DevExpress.Xpf.Spreadsheet
Assembly : DevExpress.Xpf.Spreadsheet.v25.2.dll
NuGet Package : DevExpress.Wpf.Spreadsheet
[Browsable(false)]
public Worksheet ActiveWorksheet { get; }
<Browsable(False)>
Public ReadOnly Property ActiveWorksheet As Worksheet
| Type | Description |
|---|---|
| Worksheet |
A Worksheet object that specifies the active worksheet.
|
To set an active worksheet within a workbook, assign the corresponding Worksheet object to the WorksheetCollection.ActiveWorksheet property.
// Set the second worksheet ("Sheet2") as the active worksheet.
workbook.Worksheets.ActiveWorksheet = workbook.Worksheets["Sheet2"];
' Set the second worksheet ("Sheet2") as the active worksheet.
workbook.Worksheets.ActiveWorksheet = workbook.Worksheets("Sheet2")
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ActiveWorksheet property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
wpf-spreadsheet-control-create-a-data-entry-form/CS/WpfDataEntryFormSample/MainWindow.xaml.cs#L32
{
var sheet = spreadsheetControl1.ActiveWorksheet;
//Assign custom editors to worksheet cells.
wpf-spreadsheet-control-create-a-data-entry-form/VB/WpfDataEntryFormSample/MainWindow.xaml.vb#L29
Private Sub BindCustomEditors()
Dim sheet = spreadsheetControl1.ActiveWorksheet
See Also