一、属性:

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 小结(持续添加)的更多相关文章

  1. Dev GridControl 小结3

    Dev GridControl 小结 时间 2014-03-26 19:24:01  CSDN博客 原文  http://blog.csdn.net/jiankunking/article/detai ...

  2. DEV GridControl小结。。

    [转]DEV GridControl小结.. 来自:http://www.cnblogs.com/yuerdongni/archive/2012/09/08/2676753.html   1. 如何解 ...

  3. DEV GridControl小结

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

  4. Dev gridControl z

    Dev gridControl 添加表标题 1.OptionsView ->ShowViewCaption = True 2.ViewCaption = "标题" Dev g ...

  5. 转载--DEV GridControl 的一些基本操作

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

  6. DevExpress GridControl小结

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

  7. dev GridControl实现拖拽

    一.示例说明 以gridControl1和gridControl2为例,从gridControl1拖拽行到gridControl2中去. 二.属性设置 gridControl2.AllowDrop = ...

  8. C# dev GridControl绑定数据不能显示

    如题, dev GridControl绑定数据不能显示时可检查数据操作顺序 view = advBandedGridView1 as AdvBandedGridView; //第1 this.advB ...

  9. c# dev GridControl多选当前行显示样式问题

    由于Dev GridControl在支持多选的时候,如果如果焦点行单独加了样式,Appearance-->FocusedRow  &  HideSelectionRow 这个时候,鼠标焦 ...

随机推荐

  1. C#/ASP.NET应用程序配置文件app.config/web.config的增、删、改操作

    原文 http://www.cnblogs.com/codealone/archive/2013/09/22/3332607.html 应用程序配置文件,对于asp.net是 web.config,对 ...

  2. 关于httpservletrequest的获取真实的ip

    via 值为: 下面是一些DemoWTP/1.1 GDSZ-PS-GW010-WAP05.gd.chinamobile.com (Nokia WAP Gateway 4.0 CD3/ECD13_C/N ...

  3. Unix/Linux环境C编程入门教程(1) Solaris 11 64bit环境搭建

    Unix/Linux版本众多,我们推荐Unix/Linux初学者选用几款典型的Unix/Linux操作系统进行学习. 本文就带大家来安装Solaris 11 64位并且配置好C/C++开发环境 本文所 ...

  4. keep健身计划

    下一个月计划 1keep二周计划 2百度第一期学完 3百度前端技术学院提升

  5. hadoop技术基本架构

    一.Hadoop概述 hadoop由两部分组成.各自是分布式文件系统和分布式计算框架MapReduce.当中.分布式文件系统主要用于大规模数据的分布式存储.而MapReduce 则构建在分布式文件系 ...

  6. 【Android进阶学习】shape和selector的结合使用

    shape和selector是Android UI设计中经常用到的,比如我们要自定义一个圆角Button,点击Button有些效果的变化,就要用到shape和selector.可以这样说,shape和 ...

  7. web - 块元素和内嵌元素的特征

    块: 1.独占一行 2.支持所有的样式 3.不设置宽度的时候,宽度撑满整行 常用的快标签有: div,section,header,nav,footer,article,aside,ul,ol,li, ...

  8. 获取文件数据流+叠加byte数组(给byte数组加包头包尾)

    OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "(*.mp4)|*.mp4|(*.*)|*.*"; ofd.Res ...

  9. leetcode Container With Most Water python

    class Solution(object): def maxArea(self, height): """ :type height: List[int] :rtype ...

  10. Apache与Nginx优缺点比较

    本文来源:收集.整理自互联网 1.nginx相对于apache的优点:  轻量级,同样起web 服务,比apache 占用更少的内存及资源  抗并发,nginx 处理请求是异步非阻塞的,而apache ...