添加视图或按钮链接到电网剑道 [英] Adding View or Button Link to Kendo Grid

查看:188
本文介绍了添加视图或按钮链接到电网剑道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个有点挣扎,我设法我的模型到剑道网格绑定在我的MVC应用程序。我想现在要做的就是这样,当点击它会打开与选定人员的详细信息页面一个新的浏览器窗口中添加或者是Html.ActionLink,或在每行的最后一个按钮。

After a bit of a struggle I've managed to bind my model to a Kendo Grid in my MVC app. What I want to do now is add either a Html.ActionLink or a button at the end of each row so that when clicked it opens a new browser window with the details page for the selected person.

我的网格code是这样的:

My Grid code is such:

@ModelType CDB.GridDetail
@Code

Dim myGridData As IQueryable(Of Person) = Model.GridDetailPersons

    Html.Kendo().Grid(Of Person)(myGridData) _
.Name("Grid") _
.Columns(Sub(c)
             c.Bound(Function(s) s.PersonID)
             c.Bound(Function(s) s.Status)
             c.Bound(Function(s) s.OperationsTeam)
             c.Template(Sub()
                            Html.ActionLink("View", "Details", New With {.id = "PersonID"}, New With {.target = "_blank"})
                        End Sub).Title("View").ClientTemplate("client template")
         End Sub) _
                         .Scrollable() _
                        .Render()
End Code

我遇到的问题是,我无法找到绑定的是PersonID该行的ActionLink的的.ID一种方式。我曾尝试PERSON.PERSONID和myGridData.PersonID

The issue I am having is that I can't find a way to bind the PersonID for the row to the .id of the ActionLink. I have tried Person.PersonID and myGridData.PersonID

在code,因为它是呈现网格和数据,但没有任何链接...列是空的。

The code as it is renders the grid and data but no links... the column is empty.

任何帮助AP preciated。

Any help appreciated.

推荐答案

试过理查德的回答,但这并没有工作...返回语法错误。

Tried Richard's answer but this did not work... returned syntax error.

随着他提供的链接,并寻找一些我发现这里面没有工作的其他文件的...

Following the link he provided and looking at some of the other documentation I did find this which did work...

c.Bound(Function(p) p.PersonID).Template(Function(t) @<text>@Html.ActionLink("View", "Details", New With {.id = t.PersonID}, New With {.target = "_blank"})</text>
             End Function).Title("View Details").HtmlAttributes(New With {.style = "text-align:center;"})

这是我用来取代c.Template(子.....行

which I used to replace the c.Template(Sub..... line

这篇关于添加视图或按钮链接到电网剑道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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