Skip to main content
Row

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

Worksheet.CodeName Property

Gets or sets the worksheet’s code name.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

string CodeName { get; set; }

#Property Value

Type Description
String

The code name.

#Remarks

Use the CodeName property to specify an internal worksheet name that does not change when a user renames the worksheet.

The following method returns a worksheet with the specified code name:

using DevExpress.Spreadsheet;
using System.Linq;
// ...

private Worksheet GetSheetByCodeName(IWorkbook workbook, string codeName) {
    return workbook.Worksheets.SingleOrDefault(x => x.CodeName == codeName);
}

You can also use the WorksheetCollection.Item property to access a worksheet by its index or name. See the following help topic for details: How to: Access a Worksheet.

See Also