其他分享
首页 > 其他分享> > 全选时控制某些状态不可选中

全选时控制某些状态不可选中

作者:互联网

 #region 全选过滤状态封锁数据
        private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            int count = efDevGrid1.GetSelectedDataRow().Rows.Count;//当前选中记录
            if(count==gridView1.RowCount)//控制全选时才触发
            {
                this.gridView1.CellValueChanged -= new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(this.gridView1_CellValueChanged);
                for (int i = 0; i < gridView1.RowCount; i++)
                {
                    if (gridView1.GetRowCellValue(i, "PONO_STATUS").ToString() == "0")//状态封锁
                    {
                        efDevGrid1.SetSelectedColumnChecked(i, false);
                    }
                }
                this.gridView1.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(this.gridView1_CellValueChanged);
            }
            
        }
        #endregion

 

标签:Base,Views,某些,全选,选中,gridView1,CellValueChanged,XtraGrid
来源: https://www.cnblogs.com/yjy1412/p/15084054.html