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;
            }
        }
    }
posted @ 2011-08-11 17:53  风一样的大叔  阅读(227)  评论(0编辑  收藏  举报