如何在kendo中的网格命令中添加参数 [英] how add parameter to action in command in grid in kendo

查看:91
本文介绍了如何在kendo中的网格命令中添加参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
i希望在keno网格中的编辑按钮中将参数发送到动作,但我不会这样做



这是我的代码:

hi i want to send parameter to action in edit button in keno grid,but i don't haw do it

this is my code:

    @(Html.Kendo().Grid((IEnumerable<Arda.Models.SlideShow>)ViewBag.slideshow)
.Name("gridHome")
        .Columns(columns =>
        {
            
            columns.Bound(p => p.ID).Hidden();
            columns.Bound(p => p.Title).Column.Title = "name ";
            columns.Bound(p => p.Price).Column.Title = "price";
            columns.Bound(p => p.Text).Column.Title = "price";
            columns.Command(command => command.Custom("edit").Action("Edit", "SlideShow" )).Width(100).Title("edit");
        })
         
        .Sortable()
       
    )



i想要这个:


i want this:

columns.Command(command => command.Custom("edit").Action("Edit", "SlideShow", new { id = p=>p.ID })).Width(100).Title("edit");



但是这种方式不行。

怎么样呢?


but this way dont work.
how dow it?

推荐答案

columns.Template(c => @Html.ActionLink("edit").ToString(), "foo", new { id = c.ID }));


这篇关于如何在kendo中的网格命令中添加参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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