开发人员您好,我正在使用 VS 2010。我有一个 dev express 网格,其中有一个复选框列。问题是当我选中复选框时,它会被选中,但是当我移动到任何其他单元格或列时,复选框会自动取消选中。直到现在我的代码如下
if (e.Column.ToString()=="Active" )
{
RepositoryItemCheckEdit edit = UserInfoGridView.GridControl.RepositoryItems.Add("CheckEdit") as RepositoryItemCheckEdit;
column = e.Column;
column.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
column.Visible = true;
column.VisibleIndex = 3;
column.FieldName = "CheckMarkSelection";
column.Caption = "Active";
column.OptionsColumn.ShowCaption = true;
column.OptionsColumn.AllowEdit = true;
column.OptionsColumn.AllowSize = false;
column.UnboundType = DevExpress.Data.UnboundColumnType.Boolean;
column.ColumnEdit = edit;
}