Skip to main content
Row

Worksheet.CodeName Property

Gets or sets the worksheet’s code name.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v23.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