This is a migrated thread and some comments may be shown as answers.

Hyperlink disappears on download of the file in Kendo Grid(inline batch edit)

3 Answers 334 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sujin
Top achievements
Rank 1
Sujin asked on 07 Dec 2017, 01:18 AM
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?

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 11 Dec 2017, 12:31 PM
Hello, Sujin,

Thank you for the provided code.

After I tested this, it was reproducible only when the Grid is in incell edit mode. This creates a scenario where a single click over a cell should open a link and put the cell in edit mode. As the Grid cannot determine which action should be performed it is disabling the link click after the first click.

In this scenario, we can recommend using incell edit mode to ensure that a cell click is only for the link:

http://demos.telerik.com/aspnet-core/grid/editing-inline

Let me know if you need additional information on this matter.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Sujin
Top achievements
Rank 1
answered on 11 Dec 2017, 09:59 PM

Hi Stefan

Thanks for your reply.

We have a requirement to save all added rows in a single click. Hence we use in cell editing.
Is this functionality also available with Inline edit?

If not, Do you have any workaround to fix this issue for In cell edit.

(Note: We do not have any requirement to edit the existing rows)

 

Regards

Sujin

0
Stefan
Telerik team
answered on 14 Dec 2017, 12:18 PM
Hello, Sujin,

Even if a workaround for the links is provided, the initial conflicts still stand.

Please advise the expected behavior when the user clicks on the cell. The page has to navigate to the link or the cell have to be placed in edit mode?

If the cell has to be placed in edit mode, then the link will never be clicked.

If the link has to be clicked without setting the cell in edit mode, I can suggest setting the column as not editable:

https://docs.telerik.com/aspnet-mvc/helpers/grid/configuration#model

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Sujin
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Sujin
Top achievements
Rank 1
Share this question
or