New to Kendo UI for jQuery? Start a free 30-day trial

LockColumn

methods

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

Parameters:columnNumber|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.

<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>
Not finding the help you need?
Contact Support