MVC WebGrid, row select

2019-08-03 18:22发布

问题:

I have simple WebGrid with item:

  grid.Column(format: (item) => @Ajax.ActionLink("Select", "LoadForEdit", "Receipt", new { Id = Model.Services.IndexOf(@item.Value) }, new AjaxOptions { UpdateTargetId = "ItemToEdit" }))

And i want to select when actually clicking on row, not only on 'select' item in that row. Is it possible?

回答1:

I wrote an article on making WebGrid rows "clickable" for Razor Web Pages (http://www.mikesdotnetting.com/Article/178/How-To-Make-A-WebGrid-Row-Clickable) using jQuery. You can adapt the code to MVC very easily.