有个grid 然后他的列中 有个是类似checkbox的那种的 
我想让当 x=1的时候 这个列是无法使用的 要怎么写

解决方案 »

  1.   


            private void gvProductList_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
            {
                if (e.Column.FieldName == ""&&e.cellValue="")
                    {
                        e.Column.OptionsColumn.ReadOnly = false;
                        e.Column.OptionsColumn.AllowEdit = true;
                    }
                    else
                    {
                        e.Column.OptionsColumn.ReadOnly = true;
                        e.Column.OptionsColumn.AllowEdit = false;
                    }            }          
             
            }