2011-03-03 67 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}));