DataSet ds=new DataSet();
SqlDataAdapter da=new SqlDataAdapter(strSelect,conn);
da.Fill(ds,"table");
DataGrid1.DataSource=ds.Tables["table"].DefaultView;
DataGrid1.DataBind();
for(int i=0;i<ds.Tables["table"].Count;i++)
{
if(checkBox.Checked==true)
{
  string str=ds.Tables["table"].Items[i].Cells[5].Text;
}
}

解决方案 »

  1.   

    因为没找到该checkbox控件.尝试下面看看:
    CheckBox cb = (CheckBox)e.Item.Cells[5].FindControl("cbIsActive");
    这样就可以看 cb 的 Check 状态了.
    string str = cb.Check.ToString();
      

  2.   

    dim myCheckBox as CheckBox
    myCheckBox = e.Item.Cells(5).findControl("cbIsActive",CheckBox)
    if myCheckBox.checked then
       .....
    end ifvb.net好用,你自己改成c#的吧