Spread for ASP.NET 7.0 Product Documentation
Protect Property
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetView Class : Protect Property


Glossary Item Box

Gets or sets whether users can edit cells marked as locked.

Syntax

Visual Basic (Declaration) 
Public Property Protect As Boolean
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim value As Boolean
 
instance.Protect = value
 
value = instance.Protect
C# 
public bool Protect {get; set;}

Property Value

Boolean: true to protect the cells; false otherwise

Remarks

This property is available at run time only.

When this property is set to true, when cells are marked as locked, they are immediately locked.

When this property is set to false, the user can still interact with cells marked as locked.

You can specify that certain cells are locked; that is, the user cannot edit them. You mark cells as locked using the Cell object's Locked property. Cells are not locked until the Protect property is set to true. Because the Protect property's default value is true, unless you have changed the value of the Protect property, when you mark cells as locked, they are immediately locked.

You can also set lock settings using the AlternatingRow.Locked, Column.Locked, NamedStyle.Locked, Row.Locked, and StyleInfo.Locked properties for locking rows or columns of cells, or making locked be part of a style.

Example

This example locks the spreadsheet.
C#Copy Code
FarPoint.Web.Spread.SheetView sv;
sv = FpSpread1.ActiveSheetView;
sv.Cells[0, 0, 2, 3].Locked = true;
sv.Protect = true;
Visual BasicCopy Code
Dim sv As FarPoint.Web.Spread.SheetView
sv = FpSpread1.ActiveSheetView
sv.Cells(0, 0, 2, 3).Locked = True
sv.Protect = True

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.