我想在自定义按钮上单击上传文件,我必须在网格的第一列中提及我得到的任何文件名,在第二列中,我可以为该文件添加说明,在第三项中删除它。这怎么可能? 我的代码如下:
@(Html.Kendo().Grid<Invoice.Models.ViewModels.Setup.FilesViewModel>()
.Name("FileGrid")
.Columns(columns =>
{
columns.Bound(p => p.FileName).Title("File Name").Width(100).ClientTemplate("#= AccountTransactionItemHead#" + "<input type='hidden' class='AccountTransactionItemHead' value='#=AccountTransactionItemHead#' />");
columns.Bound(p => p.Description).Title("Description").Width(140).ClientTemplate("#= AccountTransactionItemDescription#" + "<input type='hidden' class='AccountTransactionItemDescription' value='#=AccountTransactionItemDescription#' />");
columns.Command(command => command.Destroy()).Width(110);
})
.ToolBar(toolbar =>
{
toolbar.Template(@<text>
@(Html.Kendo().Upload()
.Name("files")
) </text>);
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.ServerOperation(false)
.Events(events => events.Error("error_handler"))
.Model(model =>
{
model.Id(p => p.FileID);
})
.Read("Editing_Read", "Grid")
.Destroy("Editing_Destroy", "Grid")
)
)