I am using webgrid in my razor view in MVC 3. Below is how my webGrid looks, I want to make the entire row clickable and on click pass values to the javascript method also.
I am able to achieve calling my javascript method on text of all columns. I want the same to happen for click of anywhere on the entire row.
请就此向我提供指导。 成就
@grid.GetHtml(
columns: grid.Columns(
grid.Column("CompanyName", format: @<text><a href="javascript:SubmitValues( @item.Col1 , @item.Col2 , @item.Col3 );">@item.CompanyName</a></text>, header: "ABC"),
grid.Column("CompanyAddress", format: @<text><a href="javascript:SubmitValues( @item.Col1 , @item.Col2 , @item.Col3 );">@item.CompanyName</a></text>, header: "DEF"),
))
}