Kendo Network URL Column

I want to add a hyperlink in my Kendo user interface grid. from the data source, I get the URL back, and I just want to display it as a hyperlink. Below is a sample code. Please suggest me the easiest way to do this.

<div id="testGrid" data-role="grid" data-bind="source: sampleData" data-sortable="true" data-resizable="true" /> $(document).ready(function(){ var sampleData = [ { "Title": "The Code Project", "URL": "http://codeproject.com/","Developer":"Tom Hanks" }, { "Title": "Kendo UI", "URL": "http://kendoui.com/" ,"Developer":"Tom Cruise"} ]; var ddatasource= new kendo.data.DataSource.create(sampleData); $("#testGrid").kendoGrid({ dataSource: ddatasource, columns: [{ field: "Title", title: "Title Name"}, { field: "URL", title: "URL :"}] }); }); 
+8
jquery asp.net-mvc kendo-ui kendo-asp.net-mvc kendo-grid
source share
1 answer

You can do this with a template:

 columns: [{ field: "Title", title: "Title Name"}, { field: "URL", title: "URL :", template: '<a href="#=URL#">#=Title#</a>'}] 

You can try it on Kendo Dojo here: http://trykendoui.telerik.com/aFAR

+13
source share

All Articles