Spread ASP.NET 6.0 Product Documentation
Locking a Column
Send Feedback
Spread ASP.NET 6.0 Product Documentation > Client-Side Scripting Reference > Scripting Overview > Some Simple Uses of Client Scripting > Locking a Column

Glossary Item Box

You can use client-side scripting in Spread to lock a column using code similar to this example. The following code locks and unlocks column 1 on the client side.

JavaScript Copy Code
<script language="javascript">
  function unlockCol() {
    var span = FpSpread1.all("FpSpread1_view");
    var table = span.firstChild;
    var tr;
    for (var j = 1;j<=FpSpread1.GetRowCount();j++) {
      tr = table.rows(j);
      tc = tr.cells(1);
      tc.removeAttribute("FpCellType");
    }
  }

  function lockCol() {
    var span = FpSpread1.all("FpSpread1_view");
    var table = span.firstChild;
    var tr;
    for (var j = 1;j<=FpSpread1.GetRowCount();j++) {
      tr= table.rows(j);
      tc = tr.cells(1)
      tc.setAttribute("FpCellType","readonly");
    }
  }
</script>

Return to the list of Some Simple Uses of Client Scripting.

© 2002-2012 GrapeCity, Inc. All Rights Reserved.