我有一个字段是MEMO的,在DBGRID里进行了重绘,
但我判断这个字段是否存在的语句不对,下面的assign 那一行
那位大大告诉我正确的怎么写??procedure TForm1.custDBGridDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
if assigned(custdbgrid.DataSource.DataSet.FieldByName('content'))
then////这句?????
begin
if(column.field = custdbgrid.DataSource.DataSet.FieldByName
('content')) then
begin
custDBGrid.Canvas.FillRect(Rect);
custDBGrid.Canvas.TextOut
(Rect.Left,Rect.Top,column.field.AsString);
end;
end;
end;
但我判断这个字段是否存在的语句不对,下面的assign 那一行
那位大大告诉我正确的怎么写??procedure TForm1.custDBGridDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
if assigned(custdbgrid.DataSource.DataSet.FieldByName('content'))
then////这句?????
begin
if(column.field = custdbgrid.DataSource.DataSet.FieldByName
('content')) then
begin
custDBGrid.Canvas.FillRect(Rect);
custDBGrid.Canvas.TextOut
(Rect.Left,Rect.Top,column.field.AsString);
end;
end;
end;
解决方案 »
- delphi如何备份orcal数据库?
- (新手求教)我想统计数据库第一条记录中的a的个数
- 100求一個像Windows桌面上的工具欄一樣的Toobar或者像窗口按鈕一樣的Button。2天沒人回答就當散分貼!!
- borland delphi7.0又没有类似vc的visual assist x 提示工具插件???
- ****在ListView控件MutliSelect设置为True后怎样将不按Ctrl或者Shift键就可以进行多选???****
- 用的是delphi中提供的database desktop数据库怎么做安装程序?
- 如何实现Delphi程序界面的另类风格化
- 还是觉得regedit好,但是导入reg文件时有个讨厌的对话框,有没有方法对掉?(好象有参数)
- 如何判断数据集控件是否处在EDIT状态?
- 菜鸟的烦恼
- 如何获取realaudio控件播入影音文件的总时间和播入时间??
- 不可忍受了!!!ADO的数据刷新为什么这么慢啊?
then////这句?????
换成if custdbgrid.DataSource.DataSet.FieldList.IndexOf(content)<>-1 then
存在!
then////这句?????
换成if custdbgrid.DataSource.DataSet.FieldList.IndexOf(‘content’)<>-1 then
存在!