DBGridEh的Title(表头)动态赋值
来源:互联网 发布:彩虹代刷3.9破解版源码 编辑:程序博客网 时间:2024/05/20 20:44
begin
Sql_Open(Format('select distinct wxxm_no,wxxm_mc from sm_tongji_xm where GongSiNo = ''%S'' ', [GongSiNo]), Dm_Main.ADOQuery_Temp);
with DBGridEh_temp do
begin
for i := 0 to Columns.Count - 1 do
begin
if Dm_Main.ADOQuery_Temp.Locate('wxxm_no', Columns[i].Field.DisplayLabel, []) then
Columns[i].Field.DisplayLabel := Dm_Main.ADOQuery_Temp.FieldByName('wxxm_mc').AsString
else if LowerCase(Columns[i].FieldName) = 'reco_no' then
begin
Columns[i].Field.DisplayLabel := '序号';
Columns[i].Visible := False;
end
else if LowerCase(Columns[i].FieldName) = 'flag_bs' then
begin
Columns[i].Field.DisplayLabel := '内部标识';
Columns[i].Visible := False;
end
else if LowerCase(Columns[i].FieldName) = 'xche_jsrq' then
begin
Columns[i].Field.DisplayLabel := '结算日期';
Columns[i].HideDuplicates := True;
end
else if LowerCase(Columns[i].FieldName) = 'work_no' then
begin
Columns[i].Field.DisplayLabel := '维修单号';
Columns[i].HideDuplicates := True;
end
else if LowerCase(Columns[i].FieldName) = 'che_no' then
begin
Columns[i].Field.DisplayLabel := '车牌号码';
Columns[i].HideDuplicates := True;
end
else if LowerCase(Columns[i].FieldName) = 'kehu_mc' then
begin
Columns[i].Field.DisplayLabel := '客户名称';
Columns[i].HideDuplicates := True;
end
else if LowerCase(Columns[i].FieldName) = 'xche_bz' then
begin
Columns[i].Field.DisplayLabel := '说明';
end
else if LowerCase(Columns[i].FieldName) = 'xche_heji' then
begin
Columns[i].Field.DisplayLabel := '合计';
Columns[i].Footer.ValueType := fvtSum;
//打印时0不显示
if Columns[i].Field is TBCDField then
Columns[i].Field.OnGetText := HideZeroGetText;
//标题居中
Columns[i].Title.Alignment := taCenter;
if Columns[i].Field is TStringField then
Columns[i].Width := 100
else
Columns[i].Width := 80;
end;
end;
end;
//ADOQuery中,TFloatField设置DisplayFormat
with ADOQuery do
begin
for I := 0 to Fields.Count - 1 do
begin
if LowerCase(fields[I].Classname) = 'tfloatfield' then
begin
with Fields[I] as TFloatField do
begin
DisplayFormat := '0.00';
end;
end;
end;
end;
-------------------
procedure HideZeroGetText(Sender: TField;
var Text: String; DisplayText: Boolean);
begin
if Sender is TBCDField then
begin
if Sender.AsFloat = 0 then
Text :=''
else
Text := Sender.AsString;
end;
end;
- DBGridEh的Title(表头)动态赋值
- DBGridEh点击Title排序
- DBGridEh点击Title排序
- 点击Ehlib中DbGridEh控件的title排序
- jquery给easyui-window的title赋值
- easyui-window title的赋值和获取
- Dbgrideh等控件的行间自动画颜色、表头排序的代码
- delphi dbgrideh导出到Excel 多表头
- 动态变化的自定义Title
- extjs 动态表头(亲测)
- DBGRIDEH的汉化(EhLib的汉化)
- 微信中使用js动态的修改title失效(ios)
- bootstrap的table插件动态加载表头【表头】。
- ECharts的动态赋值
- bsgrid动态表头(动态列)
- Jquery如何给网页的title取值和赋值
- html中动态分级表头的实现
- 动态表头的双向链表
- 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup
- ajax 页面模型
- Step By Step(C++模板推演)
- TTI
- hdu4203 Doubloon Game-------sg 打表找规律
- DBGridEh的Title(表头)动态赋值
- string、List<T>之类泛型定义
- 为什么opencv的canny函数检测边缘的效果和matlab的不同
- CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13+博客系统WordPress3.3.2
- [Android]Adb connection Error:远程主机强迫关闭了一个现有的连接。
- Step By Step(C++模板重载和特化)
- 如何将文件夹添加到 Visual Studio 2008 的现有工程上
- matlab用来度量图像区域属性的函数——regionprops
- Step By Step(C++模板Trait)