XtraGrid实现checkbox全选功能

  #region 全选
        /// <summary>
        /// 全选
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnF3_Click(object sender, EventArgs e)
        {
            //全选
            for (int i = 0; i < gridView1.RowCount; i++)
            {
                string strFla = gridView1.GetDataRow(i)["CHECKED1"].ToString();
                if (strFla == "True")
                {
                    gridView1.SetRowCellValue(i, "CHECKED1", false);
                }
                else
                {
                    gridView1.SetRowCellValue(i, "CHECKED1", true);
                }
            }
        }
        #endregion

 

posted @ 2014-03-28 15:45  SharkLock  阅读(353)  评论(0编辑  收藏  举报