Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I need to get WebGrid selected row values into Controller.

this is my webgrid

HTML
@{
  var g_style = new WebGrid(source: Model,
    rowsPerPage: 10);
    @g_style.GetHtml(
tableStyle: "gridTable",
headerStyle: "gridHead",
footerStyle: "gridFooter",
rowStyle: "gridRow",
alternatingRowStyle: "gridAltRow",
        columns: g_style.Columns(
        g_style.Column(header: "UserName", format: @item => item.UserName),
        g_style.Column(header: "Role", format: @item => Html.DropDownList("Role", (IEnumerable<SelectListItem>)ViewData["Role"], "--Select--" })),
        g_style.Column(header: "Approve", format: @item => Html.ActionLink("Approve", "Approve", new { id = item.UserID }))

                ))
}


here i need to get the dropdown selected value and the action link value into the controller...

Please help me....

Thanks in advance...
Posted
Updated 29-Jul-15 22:34pm
v2
Comments
Member 13396084 24-Oct-17 1:44am    
am having dropdownlist as a column of webgrid when i choose dropdownlist value i want to pass selected row value at js function or cotroller at mvc

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900