Back to Devexpress

Protection.Locked Property

officefileapi-devexpress-dot-spreadsheet-dot-protection.md

latest1.8 KB
Original Source

Protection.Locked Property

Specifies whether the cell is locked in the protected worksheet. Users cannot edit or delete content in the locked cell, enter new data, move, or resize the cell.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
bool Locked { get; set; }
vb
Property Locked As Boolean

Property Value

TypeDescription
Boolean

true to lock the cell if the worksheet is protected; otherwise, false.

|

Remarks

The following code unlocks the “C3” cell in the active worksheet. If you apply protection to this sheet, the cell remains editable in the Spreadsheet control’s UI.

csharp
spreadsheetControl1.ActiveWorksheet.Cells[2,2].Protection.Locked = false;
vb
spreadsheetControl1.ActiveWorksheet.Cells(2,2).Protection.Locked = False

See Also

How to: Protect a Worksheet

Protection Interface

Protection Members

DevExpress.Spreadsheet Namespace