0
votes

I am using Kendo() grid in my application which has binding with an model. I want to provide Upload control in Grid against each row. Please see razor view design as follows

@(Html.Kendo().Grid<Model>()
.Name("Grid")
.Columns(col =>
      {
          col.Template(@<text></text>).ClientTemplate("<a Title='Export' href='" +    Url.Action("Export", "RouteFileExport", new { Id = "#= RouteScheduleID #", routeID = "#= RouteID #" }) + "'><img src=" + @Url.Content("~/Content/images/download.png") + "></a>").Title("Export");
          col.Template(@<text>@(Html.Kendo().Upload()
                                                     .Name("attachments<#= ID #>")
                                                     .HtmlAttributes(new { id = "attachments<#= ID #>" })
                                                     .Multiple(false)
                                                     .Async(async => async
                                                          .Save("Save", "Controller", new { folder = "<#= ID #>" })
                                                         .AutoUpload(true)
                                                         )
                                                     )</text>).Title("Import");
          col.Command(command =>
              {
                  command.Destroy();
                  command.Custom("Unlock");
                  command.Custom("Notification");
              }

          );
      })

With above design i am not able to get the upload control displayed inside grid. Its displaying BLANK column.

Please let me know how can i achieve upload against each kendo grid row.

Thanks

1
Look at my question and answer... stackoverflow.com/questions/24187887/… - Robert Achmann

1 Answers

0
votes

Are you looking for a custom button in the last column? If you use the custom command buttons it can be linked to JQuery or a controller action like below:

  columns.Command(cmd => cmd.Custom("Upload").Text("Upload").Click("UploadJqueryScript")).Width(75);

  columns.Command(cmd => cmd.Custom("Upload").Action("UploadMethod", "Controller")).Width(75);

Have you tried these options?