Please i have 2 gridviews. I have been able to pass row from the first gridview to the second gridview when checkbox in first gridview is selected. But now I want to remove the row that was added to the second gridview when checkbox in the first gridview is deselected. Here's my code
$(function () {
// Calls when checkbox is checked.
$('[id*=GridView1] [id*=GridView1_chkRow]').on('click', function () {
if ($(this).is(":checked")) {
//Second Gridview.
var gridview2 = $('[id*=gvSelected]');
//Get Row Which Checbox is Selected.
var tr = $(this).closest('tr');
//Ignoring the checkbox column so that it wont get added in second gridview.
var tds = $(tr).find('td').not('.IgnoreCheckBoxColumn');
var row = '<tr>';
for (var i = 0; i < tds.length; i++) {
row += tds[i].outerHTML;
}
row += '</tr>';
//Appending selected row to second gridview.
gridview2.append(row);
}
Aucun commentaire:
Enregistrer un commentaire