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

Set New Lines in Grid Column From Data

Environment

Product Progress® Kendo UI® Grid for jQuery
Product Version 2017.3.1026

Description

How can I set the / n in the response string and display it in the Grid column without using the template? What do I have to write in the AJAX response?

Solution

To display the text on two lines without implementing the column.template, use the br tag.

  1. Send the tag as part of the response.
  2. Set encoding to false.
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { field: "name", encoded: false }
  ],
  dataSource: [ { name: "Jane Doe </br> test" } ]
});
</script>
In this article