DBGrid

Zoogreen 2003-04-25 02:42:29
不改表结构的基础上如何在DBGrid里把相同的数据屏蔽掉
例:
1 2 3 wer fdf nh
1 2 3 rfdf nh 44
1 2 3 ref nhf 544
显示为:
1 2 3 wer fdf nh
rfdf nh 44
ref nhf 544
...全文
26 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Zoogreen 2003-04-25
  • 打赏
  • 举报
回复
里面的参数如果为数据具体怎么设置??? 谢谢

rect,datacol,column,state,分别举下例子行不行
AWolfBoy 2003-04-25
  • 打赏
  • 举报
回复
在数据集的字段的OnGetText事件实现。
或者你用自画也行。
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
with DBGrid1.Canvas do
Case Column.Index of // 列号
0, 1, 2 :
begin
if 第四列的值为(wer) then
begin
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end
else
begin
FillRect(Rect);
TextOut(Rect.Left+2, Rect.Top+2, '');
end
end
else
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
zybin 2003-04-25
  • 打赏
  • 举报
回复
什么用吗?费事了吧

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧