I have a kendo grid as below :
@(Html.Kendo().Grid(Model)
.ToolBar(toolbar =>
{
toolbar.Create().Text("Add attachment");
toolbar.Save().SaveText("Save").CancelText("Cancel");
})
.Name("AttachmentsGrid")
.Columns(columns =>
{
columns.Bound(p => p.Id).Title("ID").Width(20);
columns.Bound(p => p.AttachmentType).Title("Type").Width(100).EditorTemplateName("AttachmentTypeDropDown").ClientTemplate("#:AttachmentType#");
columns.Bound(p => p.AttachmentPath).Title("Attachments").Width(200).EditorTemplateName("UploadAttachments")
.ClientTemplate("<a href='" + Url.Action("DownloadAttachment", "Utility", new { fileName = "#=AttachmentPath#" }) + "'/>" + "#=AttachmentName#" +"</a>");
columns.Bound(p => p.LastModifiedBy).Title("Uploaded By").Width(100);
columns.Bound(p => p.LastModifiedAt).Title("Uploaded On").Format("{0:dd-MMM-yyyy}").Width(100);
columns.Command(command => command.Destroy().Text(" "));
}))
The column AttachmentPath has a ClientTemplate which allows the user to download the file on click of it.
I have added an Editor Template also which displays Kendo Upload for allowing the user to browse the file for upload.
On click of the column , the download works successfully.
But after that it does not show the hyperlink – it is just displayed as simple text.
If the user wants to download again, the column needs to be sorted or the grid needs to be refreshed
How can I resolve this issue?
@(Html.Kendo().Grid(Model)
.ToolBar(toolbar =>
{
toolbar.Create().Text("Add attachment");
toolbar.Save().SaveText("Save").CancelText("Cancel");
})
.Name("AttachmentsGrid")
.Columns(columns =>
{
columns.Bound(p => p.Id).Title("ID").Width(20);
columns.Bound(p => p.AttachmentType).Title("Type").Width(100).EditorTemplateName("AttachmentTypeDropDown").ClientTemplate("#:AttachmentType#");
columns.Bound(p => p.AttachmentPath).Title("Attachments").Width(200).EditorTemplateName("UploadAttachments")
.ClientTemplate("<a href='" + Url.Action("DownloadAttachment", "Utility", new { fileName = "#=AttachmentPath#" }) + "'/>" + "#=AttachmentName#" +"</a>");
columns.Bound(p => p.LastModifiedBy).Title("Uploaded By").Width(100);
columns.Bound(p => p.LastModifiedAt).Title("Uploaded On").Format("{0:dd-MMM-yyyy}").Width(100);
columns.Command(command => command.Destroy().Text(" "));
}))
The column AttachmentPath has a ClientTemplate which allows the user to download the file on click of it.
I have added an Editor Template also which displays Kendo Upload for allowing the user to browse the file for upload.
On click of the column , the download works successfully.
But after that it does not show the hyperlink – it is just displayed as simple text.
If the user wants to download again, the column needs to be sorted or the grid needs to be refreshed
How can I resolve this issue?