Create an Asp.net Gridview with Checkbox in each row
Posted
by ybbest
on YBBest
See other posts from YBBest
or by ybbest
Published on Wed, 15 Jun 2011 12:02:52 +0000
Indexed on
2011/06/20
16:40 UTC
Read the original article
Hit count: 473
ASP.NET
One of the frequent requirements for Asp.net Gridview is to add a checkbox for each row and a checkbox to select all the items like the Gridview below. This can be easily achieved by using jQuery. You can find the complete source doe here.
$(document).ready(function () {
$(‘input[name$="CDSelectAll"]‘).click(function () {
if ($(this).attr(“checked”)) {
$(‘input[name$="CDSelect"]‘).attr(‘checked’, ‘checked’);
} else {
$(‘input[name$="CDSelect"]‘).removeAttr(‘checked’);
}
});
});
© YBBest or respective owner