altRowTemplate String|Function

The template which renders the alternating table rows. Be default the grid renders a table row (<tr>) for every data source item.

The outermost HTML element in the template must be a table row (<tr>). That table row must have the uid data attribute set to ${uid}. The grid uses the uid data attribute to determine the data to which a table row is bound to. Set the class of the table row to k-alt to get the default "alternating" look and feel.

Example - specify alternating row template

<script>
  let encode = kendo.htmlEncode;

  $("#grid").kendoGrid({
    dataSource: [ { name: "Jane Doe", age: 30 }, { name: "John Doe", age: 33 } ],
    altRowTemplate: ({ uid, name, age }) => `<tr data-uid="${uid}"><td colspan="2"><strong>${encode(name)} - </strong><strong>${encode(age)}</strong></td></tr>`
  });
</script>
In this article