The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

Worksheet.Move(Int32) Method

Moves the worksheet to another location within the workbook's collection of worksheets.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v19.1.Core.dll

Declaration

void Move(int position)
Sub Move(position As Integer)
void Move(int position)
Sub Move(position As Integer)

Parameters

Name Type Description
position Int32

An integer value specifying the zero-based destination index of the moved worksheet.

Parameters

Name Type Description
position Int32

An integer value specifying the zero-based destination index of the moved worksheet.

Remarks

Use the Move method to relocate worksheets within the IWorkbook.Worksheets collection. To obtain the actual index of the worksheet, use the Worksheet.Index property.

You can also rearrange worksheets within a workbook by using methods inherited from the Sheet interface: Sheet.MoveToBeginning, Sheet.MoveBefore, Sheet.MoveAfter, or Sheet.MoveToEnd.

Note

When you move worksheets in the document, a hidden worksheet can occupy the position of the currently active worksheet. In this case, the next visible worksheet to the right of this hidden worksheet will be automatically activated. If there are no visible worksheets to the right of the hidden worksheet, the first visible worksheet to the left of this worksheet becomes active.

Examples

This example demonstrates how to move a worksheet to another location in a workbook. To do this, call the Worksheet.Move method and pass the worksheet zero-based index specifying the position in the WorksheetCollection collection into which the worksheet should be moved.

// Move the first worksheet to the position of the last worksheet within the workbook.
workbook.Worksheets[0].Move(workbook.Worksheets.Count - 1);
See Also