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;
}
}
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;
}
}
CheckBox cb = (CheckBox)e.Item.Cells[5].FindControl("cbIsActive");
这样就可以看 cb 的 Check 状态了.
string str = cb.Check.ToString();
myCheckBox = e.Item.Cells(5).findControl("cbIsActive",CheckBox)
if myCheckBox.checked then
.....
end ifvb.net好用,你自己改成c#的吧