1.隐藏最上面的GroupPanel

gridView1.OptionsView.ShowGroupPanel=false;

2.得到当前选定记录某字段的值

sValue=Table.Rows[gridView1.FocusedRowHandle][FieldName].ToString();

3.数据只读

gridView1.OptionsBehavior.Editable=false;

4.不显示MasterDetailView

gridView1.OptionsDetail.EnableMasterViewMode=false;

5.修改最上面的GroupPanel内容

gridView1.GroupPanelText="柳生飘絮";

6.数据绑定:

FieldName --数据库的字段名称

7.读写拷贝权限设置

ColumnView.Editable
    This property returns a value of the ColumnViewOptionsBehavior.Editable option
    不可写
ColumnViewOptionsBehavior.Editable
    Gets or sets whether end users are allowed to invoke cell editors
    可读可写

OptionsColumn.AllowEdit
    Gets or sets whether end users are allowed to invoke editors for the column's cells.
    可读可写
    只有ColumnViewOptionsBehavior.Editable = True设置OptionsColumn.AllowEdit才有意义

OptionsColumn.ReadOnly
    Gets or sets whether end-users are prevented from editing the column's cell values. 
    可读可写

If the ReadOnly property is set to true, the cell values of columns cannot be modified by end-users. In this case cell editors can be invoked but end users can only select and copy an editor's content. This option is not in effect if the column's AllowEdit or the view's ColumnView.Editable option is disabled.

Cell values can still be modified in code using the ColumnView.SetRowCellValue method regardless of the ReadOnly property's setting.

只读不可拷贝:
    ColumnViewOptionsBehavior.Editable = False

只读可拷贝:
    ColumnViewOptionsBehavior.Editable = True
    OptionsColumn.AllowEdit = True
    OptionsColumn.ReadOnly = True

可编辑:
    ColumnViewOptionsBehavior.Editable = True
    OptionsColumn.AllowEdit = True
    OptionsColumn.ReadOnly = False

获取选中行的值

代码:

private void gridData_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
             _id = GWEntLib.Utilities.Mix.ConvertUtils.ToInt32(gridData.GetRowCellValu(e.FocusedRowHandle, "Id"));
             _emrFileReadList = EMRTemplateFileReadList.GetEMRTemplateFileReadList(_id);
            gridVersonData.DataSource = _emrFileReadList;
         
        }
响应事件:FocusedRowChanged
获取字段值:gridData.GetRowCellValue(e.FocusedRowHandle, "Id")
注意:FocusedRowChanged是Gridview的事件而不是gridControl的事件
gridControl与Gridview的区别:前者是容器,后者为视图

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/liushengpiaoxu/archive/2008/12/01/3420996.aspx

DevExpress中GridControl的属性设置的更多相关文章

  1. DevExpress中GridControl列转义的实现方法

    /// <summary> /// CustomColumnDisplayText Helper /// </summary> /// <param name=" ...

  2. DEV控件:gridControl常用属性设置(转载)

    特别长,先撸下来再说 1.隐藏最上面的GroupPanel  gridView1.OptionsView.ShowGroupPanel=false; 2.得到当前选定记录某字段的值  sValue=T ...

  3. DEV控件:gridControl常用属性设置

    1.隐藏最上面的GroupPanel  gridView1.OptionsView.ShowGroupPanel=false; 2.得到当前选定记录某字段的值  sValue=Table.Rows[g ...

  4. DEV控件GridControl常用属性设置

    1. 如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 2. 如何新增一条记录 (1).gridView.Ad ...

  5. devexpress中gridcontrol头部添加垂直线(右边框)

    winform开发,用devexpress中的gridcontrol控件,头部默认是3D样式,当客户希望像内容一样扁平化显示且需要添加垂直线(右边框)时恶梦开始了..经过一阵摸索发现可以这样解决: 1 ...

  6. DEV控件GridControl常用属性设置(转)

      1. 如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 2. 如何新增一条记录 (1).gridView. ...

  7. DevExpress中GridControl的使用笔记

    主要参考链接:DevExpress GridControl控件使用 Content [Level 1:基本](#Level 1:基本) [Level 2:列名](#Level 2:列名) [Level ...

  8. DevExpress中GridControl的使用笔记(转)

    转自:https://www.jianshu.com/p/badc1d2f0841 注:练习例子为: DxApplication1 -> XtraForm1 , 例子上传到本博中 2019.4. ...

  9. barmanager工具栏及gridcontrol部分属性设置

    1.工具栏部分属性设置,如:右键菜单,禁止移动等   2.gridControl属性设置,如选中行颜色,禁止移动隐藏等      

随机推荐

  1. Android自己定义组件系列【7】——进阶实践(4)

    上一篇<Android自己定义组件系列[6]--进阶实践(3)>中补充了关于Android中事件分发的过程知识.这一篇我们接着来分析任老师的<可下拉的PinnedHeaderExpa ...

  2. (原)css 响应式媒体查询 模板

    @media only screen and (max-width:340px) { html,input{ font-size:80%; } } @media only screen and (ma ...

  3. 由chkconfig 引发的联想——怎么查看程序是否已经安装/成功安装

    由chkconfig 引发的联想--怎么查看程序是否已经安装/成功安装 某天需要运行chkconfig,root登录依然找不到该命令. [root@localhost ~]# chkconfig ba ...

  4. flac文件提取专辑封面手记

    博客迁移后整理发型这篇文章当时没写完,不补了,不过还是得说明一些东西 下面这部分代码可用之处为从flac文件头开始然后各种形式的大跳,最后到达专辑封面的数据块,之后解析. 当时写的时候不会写图片解析部 ...

  5. hibernate中先建表还是先建实体类

    在实际工作中往往是先建表然后再生成类原因:建好数据库表之后往往要对数据表进行一些优化,比如说建索引,比如说建中间表,比如建视图.如果先建类的话这些优化是无法生成的

  6. Android_CodeWiki_04

    1.展开.收起状态栏      public static final void collapseStatusBar(Context ctx) { Object sbservice = ctx.get ...

  7. 管道通信之无名管道---pipe()

    pipe()函数在子进程产生之前就应该存在. 父子进程之间只进行一次传递 /*============================================ > Copyright ( ...

  8. [solaris]odbc-oracle,简单测试

    #include <string> #include <iostream> #include <stdio.h> #include <sql.h> #i ...

  9. Delphi常见图象格式转换技术

    TJPEGScale = (jsFullSize, jsHalf, jsQuarter, jsEighth);//图片大小(全部,1/2,1/4,1/8)TBitmap.pixelFormat:=pf ...

  10. Keli Linux与网络安全(1)——在VMWare中安装Keli系统

    Kali Linux是基于Debian的Linux发行版, 设计用于数字取证和渗透测试.由OffensiveSecurity Ltd维护和资助.最先由Offensive Security的Mati A ...