asp.net网站中的Gridview循环判断数据是否被选中
private void delOrderDetail(int pIndex, int pRowIndex)
{
while (pRowIndex < GridView1.Rows.Count)
{
if (((CheckBox)GridView1.Rows[pRowIndex].Cells[0].FindControl("ckFlag")).Checked == true)
{
dtTmp.Rows.RemoveAt(pIndex);
}
else
{
pIndex += 1;
}
pRowIndex += 1;
if (pRowIndex == GridView1.Rows.Count)
{
break;
}
}
}
{
while (pRowIndex < GridView1.Rows.Count)
{
if (((CheckBox)GridView1.Rows[pRowIndex].Cells[0].FindControl("ckFlag")).Checked == true)
{
dtTmp.Rows.RemoveAt(pIndex);
}
else
{
pIndex += 1;
}
pRowIndex += 1;
if (pRowIndex == GridView1.Rows.Count)
{
break;
}
}
}