Reputation: 363
I want to be able to upload a document for each row. Any ideas on how to do this?
(Html.Kendo().Grid<Model>()
.Name("Grid")
.Columns(col =>
{
col.Template(@<text>@(Html.Kendo().Upload()
.Name("attachments<#= ID #>")
.Multiple(false)
.Async(async => async
.Save("Save", "Controller", new { folder = "<#= ID #>" })
.AutoUpload(true)
)
)</text>).Title("Import");
})
)
Upvotes: 0
Views: 2183
Reputation: 878
So for a template for a column in MVC you just set the EditorTemplateName
columns.Bound(e => e.myColumn).EditorTemplateName("uploadTemplate")
And then define the template that you want to use somewhere else on the page.
<script id="uploadTemplate" type="text/x-kendo-template">
@(Html.Kendo().Upload()
.Name("attachments")
.....
.ToClientTemplate()
)
</script>
Upvotes: 1