全选反选

  /// <summary>
  /// 全选
  /// </summary>
  #region 全选
  private void btnChooseAll_Click(object sender, System.EventArgs e)
  {
   foreach(Control obj in this.ReptCourseware.Controls)
   {
    CheckBox chk = (CheckBox) obj.FindControl("checkRecord");
    if(chk!=null)
    {
     chk.Checked = true;
    }
   }
  }
  #endregion

  /// <summary>
  /// 反选
  /// </summary>
  #region 反选
  private void btnReverseChoose_Click(object sender, System.EventArgs e)
  {
   foreach(Control obj in this.ReptCourseware.Controls)
   {
    CheckBox chk = (CheckBox) obj.FindControl("checkRecord");
    if(chk!=null)
    {
     if(chk.Checked)
     {
      chk.Checked = false;
     }
     else
     {
      chk.Checked = true;
     }
    }
   }
  }
  #endregion

posted @ 2008-10-26 11:23  富硒荔枝  阅读(83)  评论(0)    收藏  举报