TDBGridEh
描述
TDBGridEh提供了TDBGrid的全部功能,并扩展了下面列出的新特性:
#允许选择记录、列和矩形区域
#可以与多个/全部列对应的特殊标题(titles)
#用于显示sum/count/其它字段值的Footer
#自动调整列宽使GRID的宽度与Client的宽度相同
#改变行和标题的高度的能力
#允许自动将含有长标题或数据的行分成多行
#标题可以用来作为按钮并且可以设置出现一个排序标记
#自动排序标记
#将长文本用省略号显示
#Lookup 列表显示多个字段
#lookup字段支持增量搜索
#固定列
#DataTime picker用于日期型的字段
#允许根据字段的值从ImageList中显示一个位图
#允许隐藏横/纵的滚动条
#允许隐藏列
#允许为固定列、Footer和数据行显示3D框架
#允许绘制Memo字段
#多行的内置编辑器
#按比例滚动DataSet序列
#自动为boolean类型字段显示checkBox,允许为其他类型字段显示checkbox
#提供将布局形式存储在注册表/INI文件中的方法
#允许在标题中以位图取代文字
#可以"禁止/允许"进行插入/删除/追加/修改记录
#允许将数据导出为: Text,CSV,HTML,RTF,XLS和内部格式
#允许从TEXT和内部格式中导入数据
#可以对不同DATASET中的数据排序/过滤
复杂标题
要创建对应多列的标题,字段的标题或GRID列的标题必须由多个由"|"分隔的部分构成,其中每个部分对于多个列是相同的.其他字段在对应部分必须包含相同的文本. 同时将DBGridEh.UseMultiTitle 属性设为True.
例如:
Field1.DisplayLabel := 'Title1|SubTitle1'; 或 DBGridEh.Columns[0].Title.Caption := 'Title1|SubTitle1';
Field2.DisplayLabel := 'Title1|SubTitle2'; 或 DBGridEh.Columns[1].Title.Caption := 'Title1|SubTitle2';
Footer and total values.
要显示FOOTER行需要设置FooterRowCount属性.
要强制GRID计算汇总值,需要激活SumList (DBGridEh.SumList.Active := True).
在Footer单元格中,可以显示某字段的合计值(记录条数/字段值/静态文本).使用Column.Footer.ValueType.
如果ValueType = fvtStaticText, 则设置Value属性.
如果ValueType = fvtFieldValue, 则设置FieldName属性.
将ValueType设置为fvtSum,grid必须显示某列字段的合计值,也可以指定Column.Footer.FieldName来计算其他字段的合计值.
如果有多于1个Footer,可以使用Column.Footers集合指定列中的每一个Footer.