Back to Devexpress

SpreadsheetControl.ActiveWorksheet Property

wpf-devexpress-dot-xpf-dot-spreadsheet-dot-spreadsheetcontrol-d51dae67.md

latest3.3 KB
Original Source

SpreadsheetControl.ActiveWorksheet Property

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

Declaration

csharp
[Browsable(false)]
public Worksheet ActiveWorksheet { get; }
vb
<Browsable(False)>
Public ReadOnly Property ActiveWorksheet As Worksheet

Property Value

TypeDescription
Worksheet

A Worksheet object that specifies the active worksheet.

|

Example

To set an active worksheet within a workbook, assign the corresponding Worksheet object to the WorksheetCollection.ActiveWorksheet property.

View Example

csharp
// Set the second worksheet ("Sheet2") as the active worksheet.
workbook.Worksheets.ActiveWorksheet = workbook.Worksheets["Sheet2"];
vb
' 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

csharp
{
    var sheet = spreadsheetControl1.ActiveWorksheet;
    //Assign custom editors to worksheet cells.

wpf-spreadsheet-control-create-a-data-entry-form/VB/WpfDataEntryFormSample/MainWindow.xaml.vb#L29

vb
Private Sub BindCustomEditors()
    Dim sheet = spreadsheetControl1.ActiveWorksheet

See Also

SpreadsheetControl Class

SpreadsheetControl Members

DevExpress.Xpf.Spreadsheet Namespace