0

我正在尝试让操作链接在此代码中工作。害怕我是一个绝对的新手,所以迫切需要帮助。该链接只需调用一个小管理窗口,该窗口链接到 UnderwriterID,即 UserName。

@(Html.Kendo().Grid<QMS.ViewModels.UnderwriterVM>()
                .Name("Grid1")
                .Columns(columns =>
                {
                    columns.Bound(p => p.PortfolioID).Width(100);
                    columns.Bound(p => p.UnderwriterID).Width(100);
                    columns.Bound(p => p.UWName).Width(100);
                    columns.Bound(p => p.UWLastName).Width(100);
                    columns.Bound(p => p.PremiumAuthority).Width(100);
                    columns.Bound(p => p.DiscountAuthority).Width(100);
                    columns.Bound(p => p.UW_ShortID).Width(100);
                    columns.Bound(p => p.MaxDiscount).Width(100);
                    columns.Template(p => @Html.ActionLink("Manage", "ManageUW", new { pfid = ViewBag.PF, uwid = Model.FirstOrDefault().UserName }));
                    columns.Command(command => { command.Destroy(); }).Width(110);
                })
                .ToolBar(toolbar =>
                    {
                toolbar.Create();
                toolbar.Save();        
                    })
                       //.Pageable()
                .Sortable()
                .Scrollable(scr => scr.Height(430))
                .Filterable()
                .Editable(editable => editable.Mode(GridEditMode.InCell))
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .Batch(true)
                    .ServerOperation(false)
                    .Create("Underwriters_Create", "Grid")
                    .Update("Underwriters_Update", "Grid")
                    .Destroy("Underwriters_Destroy", "Grid")
                    .Read("Read_Underwriters", "Grid", new { vPortId = ViewBag.PF} )
                    .Model(model =>
                                {
                                    model.Id(p => p.UnderwriterID);
                                    model.Field(p => p.PortfolioID).DefaultValue(ViewBag.PF);
                                    model.Field(p => p.UWName).Editable(true);
                                    model.Field(p => p.UWLastName).Editable(true);
                                    model.Field(p => p.PremiumAuthority).Editable(true);
                                    model.Field(p => p.DiscountAuthority).Editable(true);
                                }))
                )
4

2 回答 2

0

这是我的专栏客户模板的样子:

columns
   .Bound(p => p.UserName)
   .Title("")
   .Filterable(false)
   .Sortable(false)
   .Width(103)
   .ClientTemplate(Html.ActionLink("<span class=\"k-icon k-i-pencil\"></span>Manage", "ManageUW", "YourController", new { pfid = ViewBag.PF, uwid = "#=UserName#" }, new { @class = "k-button k-button-icontext" }).ToHtmlString());
于 2014-03-05T17:37:03.580 回答
-1

尝试这样的事情

VB代码

.ClientTemplate(Html.ActionLink("Roles", "UserRolesManage", New With {.UserId = "#=UserId#", .UserLogin = "#=UserLogin#"}).ToHtmlString()

C#代码:

.ClientTemplate(@Html.ActionLink("Roles", "UserRolesManage", New {UserId = "#=UserId#", UserLogin = "#=UserLogin#"}).ToHtmlString()
于 2014-05-05T13:44:51.213 回答