使用方法来控制Grid单元格是否可以编辑的属性,触发页面的showing_Editor事件
#region grid1编辑事件 设置选中时列进入编辑状态 private void gridView1_ShowingEditor(object sender, CancelEventArgs e) { try { this.efDevGrid1.SetAllColumnEditable(true); e.Cancel = false; GridView grid = sender as GridView; if (grid.FocusedColumn == this.efDevGrid1.SelectionColumn) { e.Cancel = false; } //选中状态 if (this.efDevGrid1.GetSelectedColumnChecked(gridView1.FocusedRowHandle) == true) { //可编辑 e.Cancel = false; } else { //不可编辑 e.Cancel = true; } } catch (Exception ex) { EF.EFMessageBox.Show(ex.Message, EF.EF_Args.epEname, MessageBoxButtons.OK, MessageBoxIcon.Error); } } #endregion
原文:https://www.cnblogs.com/yjy1412/p/14520009.html