DevExpress中GridControl的属性设置

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

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

转载于:https://www.cnblogs.com/lidingwen/archive/2010/03/22/1691487.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值