• Devexpress WinForm GridControl实现单元格可编辑状态更改


    之前做项目的时候,需要实现这样的功能。在gridcontrol中,根据是否修改(checkbox)列的选中和未选中状态来联动另外一列的编辑状态。实现如下:

     private void gridView1_ShowingEditor(object sender, CancelEventArgs e)
     {
                try
                {
                    DataRow row = gridView1.GetDataRow(this.gridView1.FocusedRowHandle);
                    if (row != null)
                    {
                        //当modifyflag的值为0时(是否修改列未选中时),设置当前行的第三列的单元格不可编辑
                        if (Convert.ToInt32(row["modifyflag"]) == 0 && gridView1.FocusedColumn.AbsoluteIndex == 3)
                        {
                            e.Cancel = true;
                        }
                    }
                }
                catch (Exception)
                {
    
                    throw;
                }
      }
  • 相关阅读:
    typedef用法小结
    14种排序
    常用google产品
    去重排序
    双向链表
    IDEA上传一个项目到github
    IDEA上传一个项目到github
    Git的安装
    Hibernate 加载策略得总结
    hadoop -- fsck
  • 原文地址:https://www.cnblogs.com/xiaomianyang/p/7511151.html
Copyright © 2020-2023  润新知