日期:2014-05-19  浏览次数:20446 次

高手请进,用gridview绑定多选框,怎么获取是否选中,获取选中的那个?
高手请进,用gridview绑定多选框,怎么获取是否选中,获取选中的那个?

------解决方案--------------------
for (int i = 0; i < GridView1.Rows.Count; i++)
{
bool isChecked = ((CheckBox)GridView1.Rows[i].FindControl( "CheckBox1 ")).Checked;
if (isChecked)
{
}
else
{
}


------解决方案--------------------
我有现成的代码:
int count=GridView1.Rows.Count;
for (int i = 0; i < count; i++)
{
if (((CheckBox)GridView1.Rows[i].Cells[0].Controls[1]).Checked == true) //Cells[0] 要看你把checkbox 放在第几个了
{}