Edit this page

lockColumn

Locks (freezes) a column, allowing users to see it at all times when scrolling.

Parameters

column Number |String

The index of the column or the field to which the columns is bound.

In order to use this method, the grid must be initialized with at least one locked column, and should have unlocked columns left after the target column is locked.

Example - lock a column

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { field: "name", width: 400, locked: true },
    { field: "age", width: 200 },
    { field: "hometown", width: 400 },
    { field: "siblings", width: 200 }
  ],
  dataSource: [
    { name: "Jane Doe", age: 30, hometown: "Sofia, Bulgaria", siblings: 3 },
    { name: "John Doe", age: 33, hometown: "Boston, MA, USA", siblings: 1 }
  ]
});
var grid = $("#grid").data("kendoGrid");
grid.lockColumn("age");
</script>