选择在asp.net的GridView多个复选框不工作 [英] select multiple checkbox in gridview in asp.net not working
问题描述
我用这code在 asp.net选择在
,但它是不工作 GridView控件
多个复选框
保护无效cbheader_CheckedChanged(对象发件人,EventArgs的发送)
{ 的foreach(GridViewRow gridViewRow在GridView1.Rows)
{
((复选框)gridViewRow.FindControl(chkcol))
.Checked =((复选框)发送方).Checked;
}}
尝试JavaScript来检查所有复选框在DataGrid中。回发请求是不是解决这个问题的好办法。还有就是如何实现使用JavaScript这样的功能一个很好的例子:
<一href=\"http://www.aspsnippets.com/Articles/Implement-check-all-checkbox-functionality-in-ASPNet-GridView-control-using-JavaScript.aspx\"相对=nofollow>实施检查使用JavaScript 在ASP.Net GridView控件的所有复选框功能
I am using this code to select multiple checkbox in GridView
in asp.net
but it is not working
protected void cbheader_CheckedChanged(object sender, EventArgs e)
{
foreach (GridViewRow gridViewRow in GridView1.Rows)
{
((CheckBox)gridViewRow.FindControl("chkcol"))
.Checked = ((CheckBox)sender).Checked;
}
}
Try JavaScript to check all checkboxes in DataGrid. Postback requests is not a good idea to solve this. There is a good example of how to implement such functionality using JavaScript: Implement check all checkbox functionality in ASP.Net GridView control using JavaScript
这篇关于选择在asp.net的GridView多个复选框不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!