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

 

你可能感兴趣的:(checkbox)