EhLib.Com
https://forum.ehlib.com/en/

DBGridEh - Override text in Cell
https://forum.ehlib.com/en/viewtopic.php?f=5&t=1186
Page 1 of 1

Author:  MichaelJ [ 27 Nov 2022, 10:57 ]
Post subject:  DBGridEh - Override text in Cell

Hi,

I want to set the text to 'X' when the Fieldname is 'ARTID' and the value is '1'. The following code didn't work. What ist the best solution todo it?

Code:
    if ((Column.FieldName = 'ARTID') and ((TDBGridEh(Sender).DataSource.DataSet.FieldByName('ARTID').asInteger=1) then
    begin
      text:='X';
      ARect:= Rect;
      TDBGridEh(Sender).Canvas.FillRect(ARect);
      drawTextEh(TDBGridEh(Sender).Canvas.Handle,Pchar(Text),length(Text),ARect,DT_Right);
    end;


I use it in OnDrawColumnCell.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/