DEV GridControl 小结(持续添加)
一、属性:
1、Views
OptionsBehavior=>Editable:False 列表不可编辑
OptionsSelection=>EnableAppearanceFocusedCell :False 选中整行
在设置了奇偶行样式后需要起用设置,不然无效
OptinsView=>EnableAppearanceEvenRow :True 起用偶数行样式
OptinsView=>EnableAppearanceOddRow :True 起用奇数行样式
OptinsView=>ShowGroupPanel:False 隐藏分组面板
2、Columns
SortOrder 设置按该列排序方法 (Descending:降序 ;Ascending:升序)
UnboundType 设置为非绑定列,并设置数据类型
ColumnsEdit 可以在该列中添加控件,在 In-place Editor中添加控件,ButoonEdit为按钮
点中按钮获取焦点行
if (this.gvMain_Blood.FocusedRowHandle < )
return;
如果设置了主从表结构,那么在从表中为
DevExpress.XtraGrid.Views.Grid.GridView gv = (DevExpress.XtraGrid.Views.Grid.GridView)gcMain.FocusedView;
int a = gv.FocusedRowHandle;
if (a < )
return;
3、Appearance
FocusedRow 被选中行样式设置
EvenRow 偶数行样式设置
OddRow 奇数行样式设置
GroupRow 分组行样式设置
4、其它属性设置
ExpandMasterRow 展开所有子表
if (gv.RowCount > )
{
for (int i = ; i < gv.RowCount; i++)
{
this.gv.ExpandMasterRow(i);
}
}
二、事件
CustomDrawRowIndicator 自动添加行号
if (e.Info.IsRowIndicator &&e.RowHandle>=)
{
e.Info.DisplayText = (e.RowHandle + ).ToString();
}
CustomUnboundColumnData 非绑定列数据绑定
if (e.RowHandle < )
return;
if (e.Column.FieldName == "非绑定列列名")
{
e.vaule="值";
}
RowClick 行选中事件
CustomColumnDisplayText 自定义列
//绑定列值为空时显示固定字符串
if (e.Column.FieldName == "列名")
{
if (e.Value == null)
{
e.DisplayText = "字符串";
}
}
Blood_MasterRowGetChildList 绑定从表数据
if (e.RowHandle < 0)
return;
List<T> dateList=new List<T>
e.ChildList = dateList
MasterRowGetRelationCount 设置从表个数
e.RelationCount = 1;
MasterRowGetRelationName 主从表关系设置
e.RelationName = "Detail"; //从表LevelName 一定要设置为Detail才能关联主从表
CustomDrawEmptyForeground 查询得到0条数据时显示自定义字符
if (this.gv.RowCount==)
{
string str = "没有查询到信息!";
Font f = new Font("宋体", , FontStyle.Bold);
Rectangle r = new Rectangle(e.Bounds.Left + , e.Bounds.Top + , e.Bounds.Width - , e.Bounds.Height - );
e.Graphics.DrawString(str, f, Brushes.Black, r);
}
DEV GridControl 小结(持续添加)的更多相关文章
- Dev GridControl 小结3
Dev GridControl 小结 时间 2014-03-26 19:24:01 CSDN博客 原文 http://blog.csdn.net/jiankunking/article/detai ...
- DEV GridControl小结。。
[转]DEV GridControl小结.. 来自:http://www.cnblogs.com/yuerdongni/archive/2012/09/08/2676753.html 1. 如何解 ...
- DEV GridControl小结
1. 如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 2. 如何新增一条记录 (1).gridView.Ad ...
- Dev gridControl z
Dev gridControl 添加表标题 1.OptionsView ->ShowViewCaption = True 2.ViewCaption = "标题" Dev g ...
- 转载--DEV GridControl 的一些基本操作
1. 如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 2. 如何新增一条记录 (1).gridView.Ad ...
- DevExpress GridControl小结
1. 如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 2. 如何新增一条记录 (1).gridView.Ad ...
- dev GridControl实现拖拽
一.示例说明 以gridControl1和gridControl2为例,从gridControl1拖拽行到gridControl2中去. 二.属性设置 gridControl2.AllowDrop = ...
- C# dev GridControl绑定数据不能显示
如题, dev GridControl绑定数据不能显示时可检查数据操作顺序 view = advBandedGridView1 as AdvBandedGridView; //第1 this.advB ...
- c# dev GridControl多选当前行显示样式问题
由于Dev GridControl在支持多选的时候,如果如果焦点行单独加了样式,Appearance-->FocusedRow & HideSelectionRow 这个时候,鼠标焦 ...
随机推荐
- IC卡存储器介绍
自从80年代中期出现IC电话卡后,基本已取代了原来流行的电话磁卡,磁卡存在存在严重的安全问题,已逐步淘汰.即使IC电话卡,也不能算很安全,卡内所有数据只要有简单的读写装置并按时序操作都能读取,事实上电 ...
- 第五章 Spring3.0 、Hibernate3.3与Struts2的整合 基于Annotation
Annotation的方式是通过注解的方式把Struts2中的Action.Dao层的实现类.Service层的实现类交由Spring管理,不需要在配置文件中进行配置.但为了方便,事务的管理依然使用的 ...
- windows的命令行工具和DOS工具的区别
很多的系统管理员可能认为命令行是程序员编程用的,这是不对的,其实命令行是另一种用来管理计算机的接口.1 命令行窗口 Windows NT/Windows 2000以后的操作系统为用户提供 ...
- chroot 的用途
http://www.ibm.com/developerworks/cn/linux/l-cn-chroot/ http://liyongxian.blog.51cto.com/432519/1126 ...
- cf-A. Wet Shark and Odd and Even(水)
A. Wet Shark and Odd and Even time limit per test 2 seconds memory limit per test 256 megabytes inpu ...
- 君子性非异也,善假于物也 - Threejs 引入TrackballControls 查看场景
君子性非异也,善假于物也 - Threejs 引入TrackballControls 查看场景 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循" ...
- 数据结构中La表的数据合并到Lb表中
实验描述:La表中的数据为(3,5,8,11) Lb 表中的数据为(2,6,8,9,11,15,20) 将La表中的数据而不存在Lb表的数据插入到Lb表中,从而实现并集操作. 出现的问题:最后实现的 ...
- 高效的SQLSERVER分页查询(推荐)
Sqlserver数据库分页查询一直是Sqlserver的短板,闲来无事,想出几种方法,假设有表ARTICLE,字段ID.YEAR...(其他省略),数据53210条(客户真实数据,量不大),分页查询 ...
- makefile之cmake入门
cmake是一款生成makefile的软件:在生成makefile之前,首先是写一个CMakeLists.txt文件: 以下为典型例子: 先看目录tree, 在test文件夹中有:include目录, ...
- javaScript 工作必知(五) eval 的使用
eval eval(parse) parse :里面跟参数字符串,我们知道执行javascript 会编译执行, 改变全局变量的值: var x = 2; //定义的全局变量 alert(x); ...