//遍历
        foreach(GridViewRow gv  in this.gvPostInfo.Rows )
        {
            CheckBox check = gv.FindControl("chkUser") as CheckBox;
            if (check.Checked)
            {                //得到id  -----------------------“问的是 这一行”转不过去 有值
               int Did =convert.ToInt32( gv.colls[1].Text);
                //执行方法
                int result = PostHistoryManager.DeleteByidPostHistory(Convert.ToInt32(Did));
                //判断删除效果
                if (result > 0)
                {
                    Page.RegisterStartupScript("", "<script>alert('删除成功!')</script>");
                }
            }//重载
            DisplayP();
            
        }

解决方案 »

  1.   

    gv.colls[1].Text 这里的值是什么?
      

  2.   

    Int32.Parse(row.Cells[1].Text)  colls是不是这里写错了?
      

  3.   

    gv.colls[1].Text是 一个string类型的 uid列
      

  4.   

    int Did =convert.ToInt32( gv.cells[1].Text);) 总是说 输入格式不对!~~~~~~
      

  5.   

    用模板列   然后  像这样子用 gv.FindControl("chkUser") as TextBox  
      

  6.   

    gv.colls[1].Text 值?
    int i=0;
    int.TryParse(gv.colls[1].Text,out i);