How can i get selected records inside webgrid by checkbox in mvc without using Html.BeginForm.
I want to copy some rows from grid to another grid ??
How can i do this in MVC with javascript or Jquery or any other solution ?
Thanks
Hi Andrea
I hope i was clear in my explaniation i deal with webgrid in mvc
i want to access checkbox control in grid to get select rows
how can i do this ??
Hi MElbakly,
Refer the below code.
$('#webgrid1 input[type=checkbox]').on('click', function () { if ($(this)[0].checked) { var headerRow = $('#webgrid1 tbody tr:first').clone(true); var row = ''; var tds = ''; $($(this).closest('tr').find('td')).each(function (i, item) { if (i > 0) { tds += item.outerHTML; } }); row += "<tr>" + tds + "</tr>"; $('#webgrid2').append(row); } });
Hi dharmendr
Thanks for your reply this code is works good but i need to access the checkbox control i want to get the id for selected row and passs it to controller how can i do this ?
please help
It is not possible to pass the checked value to controller without using Html.BeginForm. If you don't want to use HTML.BeginForm then you have to make use of ajax call.
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.