事件代码:
foreach(DataGridItem CheckBoxItem in ArticleList.Items)
{
   CheckBox ischeck = (CheckBox)ArticleList.FindControl("DeleteCheckBox");
   if(ischeck == true)
   {
       .......;
   }
}if(...)这行报错,到底是怎么回事??

解决方案 »

  1.   

    foreach(DataGridItem CheckBoxItem in ArticleList.Items)
    {
       if (CheckBoxItem is CheckBox)
       {
       CheckBox ischeck = (CheckBox)ArticleList.FindControl("DeleteCheckBox");
       if(ischeck == true)
       {
           .......;
       }
       }
    }
      

  2.   

    if (CheckBoxItem is CheckBox)
    请问这句话是什么意思?
      

  3.   

    if(ischeck.Checked)
    依然报同样的错
      

  4.   

    foreach(DataGridItem CheckBoxItem in ArticleList.Items)
    {
       CheckBox ischeck = (CheckBox)CheckBoxItem.FindControl("DeleteCheckBox");
       if(ischeck.Checked)
       {
           .......;
       }
    }
      

  5.   

    for(int intDs = 0; intDs < dg_List.Items.Count;intDs++)
    {
    string str1 = ((HtmlInputCheckBox)this.dg_List.Items[intDs].FindControl("dg_List_chk_Receive")).Checked ?"Y":"N" ;
    string str2 = ((HtmlInputCheckBox)this.dg_List.Items[intDs].FindControl("dg_List_chk_Approve")).Checked ?"Y":"N" ;
    string str3 = ((HtmlInputCheckBox)this.dg_List.Items[intDs].FindControl("dg_List_chk_Return")).Checked ?"Y":"N" ;
    string str4 = ((HtmlInputCheckBox)this.dg_List.Items[intDs].FindControl("dg_List_chk_Release")).Checked ?"Y":"N" ; // whether change
    if(str1.Equals((dsUpt.Tables[0].Rows[intDs]["rpt_receive"].ToString())) &&
    str2.Equals((dsUpt.Tables[0].Rows[intDs]["rpt_approve"].ToString()))&&
    str3.Equals((dsUpt.Tables[0].Rows[intDs]["rpt_return"].ToString())) &&
    str4.Equals((dsUpt.Tables[0].Rows[intDs]["rpt_releaSe"].ToString())))
    {
    continue;
    }
    else
    {
    dsUpt.Tables[0].Rows[intDs]["rpt_receive"] = str1;
    dsUpt.Tables[0].Rows[intDs]["rpt_approve"] = str2;
    dsUpt.Tables[0].Rows[intDs]["rpt_return"] = str3;
    dsUpt.Tables[0].Rows[intDs]["rpt_release"] = str4;

    dsUpt.Tables[0].Rows[intDs]["UPDT_UID"] = UserInfo.UID;
    }
    }
      

  6.   

    看看DeleteCheckBox有没有被引用
      

  7.   

    倒~~~checkbox用的是html控件!!不是web服务器控件!!
    崩溃!!
    谢谢大家帮助!结贴!