开发者

MVC3 Web Datagrid, Action on clicking select

I am using MVC3 WebGrid that has a select column like so

 grid.Column(
  开发者_如何学运维    header: "",
      style: "text-align-center",
      format: (item) => item.GetSelectLink()),  

I want this to change the value of one of my Model properties and to update a text box when the user press the select link. How is this possible?


I understand your requirement as you need a link where clicking on the link should open up a new view and should amend the value in the text box.

I am assuming you will be clicking on this link, once you click it will open in new view.( You should create this view) and you can edit the value and save the record.

grid.Column(header: "",
      style: "text-align-center",format: (item) => Html.ActionLink("Edit The Record", "ActionNameWhereYouWantOpenTheRecordAndEdit", "ControllerName", new { id = item.id }, null))

You should do the neccessary change in Global.asax as well to route the request.

Let me know if you need more info.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜