2011-03-03 54 views
0

另一column.bound.format我有这样的代码在我看来:是否有可能获得价值列ID,在Telerik的网格,MVC3和剃刀

columns.Bound(o => o.jobname).Width(100); 
columns.Bound(o => o.objid) 
    .Format(Ajax.ActionLink("delete", "QuotesDelete", new { id = "{0}" }, new { @class = "delete-link" }) 
    .ToHtmlString()) 
    .Encoded(false) 
    .Title(""); 

现在我想用作业名列作为编辑链接,所以我将作业名称 更改为以下内容。

columns.Bound(o => o.jobname).Format(Ajax.ActionLink("{0}", "QuotesDetail", new { id = "is-it-possible-to-get-objid-value" }) 
     .ToHtmlString()) 
     .Encoded(false); 

是否有可能获得在routeValues的objid价值?

回答

0

如果您需要使用Format,则不可能。格式实际上是string.Format的快捷方式。如果您想要完全访问权限,请考虑设置列(客户端或服务器)的模板。这里是一个例子:

columns.Bound(o => o.objid).Template(@Ajax.ActionLink("Delete", "QuotesDetail", new { id = @item.objid}));