Kendo MVC:向网格添加编辑,删除按钮 [英] Kendo MVC: Adding Edit, Delete Buttons to Grid

查看:59
本文介绍了Kendo MVC:向网格添加编辑,删除按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有下表:

    @Html.Kendo().Grid(Model).Name("Staff").Columns(x =>
    {
        x.Bound(y => y.StaffId);
        x.Bound(y => y.FirstName);
        x.Bound(y => y.LastName);
        x.Bound(y => y.Email);
        x.Bound(y => y.Phone);
        x.Command(y => y.Custom("Edit").Action("edit", "controller", new { id = ????? }));

    }).Sortable().Scrollable().Pageable(x=> x.PageSizes(true)).Filterable()

如何将与行关联的主键值(在这种情况下为StaffId)传递给对象路由值,类似于通过Visual Studio自动脚手架进行的操作?

How can I pass the primary key value (StaffId in this case) associated to the row to the object route values similar to the way it is done by Visual Studio auto-scaffold?

推荐答案

一遍又一遍地使用网格之后,我终于可以解决问题了.在这里,您去了

After playing with the grid over and over, I could finally solve the problem. Here you go:

x.Bound(y => y.Title).Template(y=> "<a href=\""+y.Title+"\">Click Me</a>")

这篇关于Kendo MVC:向网格添加编辑,删除按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆