.隐藏最上面的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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)