@(Html.Kendo().Grid<positions.Models.vOpenPositionsDistinct>()
.Name("gridMain")
.DataSource(dataSource => dataSource // Configure the grid data source
.Ajax() // Specify that ajax binding is used
.Read(read => read.Action("Positions_Read", "Home")) // Set the action method which will return the data in JSON format
)
.Columns(columns =>
{
columns.Bound(s => s.SourceURL).ClientTemplate("<a href='" + Url.Content("#= SourceURL #") + "' target='_blank'>#: SourceURL #</a>").HeaderTemplate("Source URL").Width(120);
})
I have external url links stored in my database and I want to bind them in a grid column as <a href> tag. If I use the code above all rows will have the 1st row SourceURL Value .
What am I doing wrong? It seems as if it creates a generic template for all rows and the template has same url.
.Name("gridMain")
.DataSource(dataSource => dataSource // Configure the grid data source
.Ajax() // Specify that ajax binding is used
.Read(read => read.Action("Positions_Read", "Home")) // Set the action method which will return the data in JSON format
)
.Columns(columns =>
{
columns.Bound(s => s.SourceURL).ClientTemplate("<a href='" + Url.Content("#= SourceURL #") + "' target='_blank'>#: SourceURL #</a>").HeaderTemplate("Source URL").Width(120);
})
I have external url links stored in my database and I want to bind them in a grid column as <a href> tag. If I use the code above all rows will have the 1st row SourceURL Value .
What am I doing wrong? It seems as if it creates a generic template for all rows and the template has same url.