Why my grid column template is not working
@(Html.EJ().Grid<ApplicationCore.Entities.Distributor>("TGrid")
.Datasource(dataSource =>
{
dataSource.Json(Model);
dataSource.Adaptor(AdaptorType.RemoteSaveAdaptor);
dataSource.CrudURL(Url.Action("Crud"));
dataSource.SerializerMode(SerializerMode.NewtonSoft);
dataSource.SerializerSettings(new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore });
})
.Columns(col =>
{
col.Field(c => c.Id).IsPrimaryKey(true).IsIdentity(true).Add();
col.Field(c => c.DistributorName).Add();
col.Field(c => c.FriendlyUrl).Add();
col.Field(c => c.WebsiteUrl).Add();
col.Field(c => c.ImageFilename).Template("#template").Add();
col.Field(c => c.ListImageFilename).Add();
})
<script id="template" type="text/x-template">
<a rel='nofollow' href="@Url.Content("~/${ImageFilename}")" target="_blank">${ImageFilename}</a>
</script>
It will render
${ImageFilename}