Spread Silverlight Documentation
GrapeCity.Windows.SpreadSheet.Data Namespace / Column Class / Locked Property
Example


In This Topic
    Locked Property (Column)
    In This Topic
    Gets or sets whether a column is marked as locked from editing.
    Syntax
    'Declaration
     
    <DefaultValueAttribute(False)>
    Public Property Locked As Boolean
    'Usage
     
    Dim instance As Column
    Dim value As Boolean
     
    instance.Locked = value
     
    value = instance.Locked
    [DefaultValue(false)]
    public bool Locked {get; set;}

    Property Value

    true if the column cells are locked; otherwise, false. The default value is false.
    Example
    This example only allows certain cells to be edited.
    gcSpreadSheet1.Sheets[0].Cells[1, 1].Locked = false;
    gcSpreadSheet1.Sheets[0].Cells[1, 1].Text = "Locked";
    gcSpreadSheet1.Sheets[0].Columns[3].Locked = false;
    gcSpreadSheet1.Sheets[0].Rows[5].Locked = false;
    gcSpreadSheet1.Protect = true;
    gcSpreadSheet1.Sheets[0].Protect = true;
    gcSpreadSheet1.Invalidate();
    
    private void button1_Click(object sender, RoutedEventArgs e)
            {
    gcSpreadSheet1.Sheets[0].Cells[1, 1].ResetLocked();
    gcSpreadSheet1.Invalidate();
            }
    GcSpreadSheet1.Sheets(0).Cells(1, 1).Locked = False
    GcSpreadSheet1.Sheets(0).Cells(1, 1).Text = "Locked"
    GcSpreadSheet1.Sheets(0).Columns(3).Locked = False
    GcSpreadSheet1.Sheets(0).Rows(5).Locked = False
    GcSpreadSheet1.Protect = True
    GcSpreadSheet1.Sheets(0).Protect = True
    GcSpreadSheet1.Invalidate()
    
    Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
    GcSpreadSheet1.Sheets(0).Cells(1, 1).ResetLocked()
    GcSpreadSheet1.Invalidate()
    End Sub
    See Also