<div>Hi Drdexter33,</div> <div>It is also pretty simple stuff to get the select row in WebGrid Helper. You can use @item.GetSelectLink outputs a HTML anchor tag with the row selected. This is passed as a QueryString, and the name of the QueryString is set by
the selectionFieldName property set on the grid:
Forest Cheng...
Star
8370 Points
819 Posts
Re: MVC3 WebGrid Question.
Mar 31, 2011 05:12 AM|LINK
WebGrid grid = new WebGrid(Model, selectionFieldName:"SelectedRow"); @grid.GetHtml( columns:grid.Columns( grid.Column("Edit",header:null,format:@<text>@item.GetSelectLink("Edit")</text>), grid.Column("Name", "Name", style: "product"), grid.Column("Description", format: @<i>@item.Description</i>), grid.Column("Category", format: @<text>@item.Category</text>), grid.Column("Price",format:@<i>@item.Price</i>) ))</div> <div>To find out which row is selected is just as easy, something like this:@if (grid.HasSelection) { //Do what thing you want here.... @{Html.RenderAction("Delete","Home",new {product = grid.SelectedRow});} }</div> <div> </div> <div>Hope this helpful,</div> <div>Forest Cheng</div>If you have any feedback about my replies,please contact msdnmg@microsoft.com.
Microsoft One Code Framework