none
How to get grid row value on selecting radio button in grid using in Razor RRS feed

  • Question

  • Hi EveryBody,

       I am using VS2012 and Razor for displaying data in grid.

       I add radio-button in grid

      I want to retrieve data of selected radio-button  row in grid

      What will be the codes...?

    Code is as below

    @foreach (var item in Model) {
        <tr>
            <td>
                @Html.RadioButtonFor(modelItem => item.id, "rb")

            </td>
            <td>
                @Html.DisplayFor(modelItem => item.id)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.solicitante.name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.servico.nome)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.status)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.data_solicitacao)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.pta_hrs)
            </td>
        </tr>
    }

     How to get value in "rb"

    Controller codes

     [HttpPost]
            public ActionResult Index(string status,string rb)
            {
               
               TempData["clientName"] = base.ClientName;
              return View(db.GetSolicitacaoServicoByFiltersprocess(base.ClientId, null, null, status));

            }



    • Edited by Vivek Naik Wednesday, November 13, 2013 2:06 PM
    Wednesday, November 13, 2013 1:52 PM