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. 【设计模式】学习笔记13:组合模式(Composite)

    本文出自   http://blog.csdn.net/shuangde800 认识组合模式 上一篇中,我们可以用迭代器来实现遍历一个集合(数组,ArrayList, Vector, HashTabl ...

  2. 位运算 (&|)与--或 一位数组表示多种意思~~ 与--或

    var arr:Array = [0,1,2,4,8,16] var gate:int = 0; gate |= arr[1] gate |= arr[2] gate |= arr[3] trace( ...

  3. XP用户:消除误解,大胆拥抱Linux

         4月23日.知名家评论家Silviu Stahie发表文章.题为"Windows Users and Their Misconceptions About Linux". ...

  4. Object-c学习之路七(oc字符串操作)

    // // main.m // NSString // // Created by WildCat on 13-7-25. // Copyright (c) 2013年 wildcat. All ri ...

  5. 使用HTML5/CSS3制作便签贴

    利用HTML5/CSS3,仅用5步就可以制作便签贴效果的HTML页面,效果图如下: (注:图里的文字纯属杜撰,搞笑目的,如有雷同,纯属巧合,谢谢!) 注:该效果可以在Safari, Chrome,Fi ...

  6. ASPNET程序中常用的三十三种代码

    1. 打开新的窗口并传送参数 response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.S ...

  7. 关于rem自适应的一点研究

    参考地址:http://m.ctrip.com/html5/ https://www.amazon.cn/ rem是相对于html根元素的一个单位.rem是px的16倍,即1rem = 16px;除了 ...

  8. oracle中set define off

    set define off关闭替代变量功能 在SQL*Plus中默认的"&"表示替代变量,也就是说,只要在命令中出现该符号,SQL*Plus就会要你输入替代值.这就意味着 ...

  9. iOS 类管理

    CocoaPods安装和使用教程 Code4App 原创文章.转载请注明出处:http://code4app.com/article/cocoapods-install-usage 目录 CocoaP ...

  10. iOS设计模式解析(一)工厂方法

    工厂方法:定义创建对象的借口,让子类决定实例化哪一个类.工厂方法是一个类的实例化延迟到了子类 例如      :Shoes厂有两个子类(Newbalance.Nike)构建类图如下: 代码实现: #i ...