columns Array

The columns of the grid initialized from the columns option. every item from the columns array has the same fields as the corresponding columns option.

Example - iterate the grid columns

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { field: "name" },
    { field: "age" }
  ],
  dataSource: [
    { name: "Jane Doe", age: 30 },
    { name: "John Doe", age: 33 }
  ]
});
var grid = $("#grid").data("kendoGrid");
for (var i = 0; i < grid.columns.length; i++) {
  console.log(grid.columns[i].field); // displays "name" and then "age"
}
</script>
In this article
Not finding the help you need? Improve this article