网上文摘 小说 Flash游戏 最近更新 下载排行 资源分类 下载指南
经典编程资源 精彩不容错过
设为首页
加入收藏
联系我们
当前位置:Delphi园地技巧文章控件使用Ehlib → 定制Ehlib网格标题
定制Ehlib网格标题
日期:2005年12月4日 作者: 人气: 查看:[大字体 中字体 小字体]
-【复杂标题】
  TDBGridEh 允许在多列上创建标题,设置 DBGridEh.UseMultiTitle 属性为 True 并且填充字段的标签或列标题的标题,可以使用下面的规则:字段标签中的文本部分或列标题必须由几部分组成,并且用 "|" 分割,几个列的每一个通用部分都设置为相同。其它字段或标题必须在相应的部分包含同样的文本。

例如:
Field1.DisplayLabel := 'Title1|SubTitle1';
Field2.DisplayLabel := 'Title1|SubTitle2';

DBGridEh.Columns[0].Title.Caption := 'Title1|SubTitle1';
DBGridEh.Columns[1].Title.Caption := 'Title1|SubTitle2';

-【按钮式标题】
  设置Column.Title.TitleButton 为 True可以强制标题单元为按钮式。写 OnTitleBtnClick事件来控制用户单击标题单元时的操作。

-【在标题中显示位图】
  To show bitmap in titles instead of caption use TitleImages property of TDBGridEh and ImageIndex property of TColumnTitleEh.

-【自动用位置标识排序标题】.
  TDBGridEh allows to show special sortmarking bitmaps (small triangles) in the right part of title cell. In order to automatically marking title by sortmarking bitmaps add dghAutoSortMarking to OptionsEh property. Add dghMultiSortMarking too in order to allow sortmarking several columns simultaneously. Set Column.Title.TitleButton to true for titles which will have possibility to change sortmarkers at run time. At runtime clicking on title will change sortmarking. Holding Ctrl key allows to mark several columns simultaneously. After user change sormarking grid call OnSortMarkingChanged event. You can write this event to change sorting and reopen in dataset. Use SortMarkedColumns property to access to sortmarked columns.

-【标题属性的默认值】
  使用TDBGridEh.ColumnDefValues.Title来设置标题属性的默认值。

(出处:DelphiFans.com)

相关文章:
·DbGrid控件隐藏或显示标题栏
·DbGrid控件的标题栏弹出菜单
·DbGrid控件的标题栏弹出菜单
·巧用DBGrid控件的Sort属性实现“点击标题栏自动排序功能
·用鼠标拖动无标题窗口
·查阅可视窗口标题
·巧用DBGrid控件的Sort属性实现“点击标题栏自动排序功能”。(改进版)
·单击DBGridEh的标题栏排序
·无标题窗体拖动
 → 特别推荐
 → 热点TOP10
关于我们 | 广告服务 | 发布资源 | 联系站长 Copyright © 2002-2006 Delphi园地 All Rights Reserved