NULL representation in TCRDBGrid

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
[email protected]
Posts: 27
Joined: Fri 12 Feb 2010 07:44

NULL representation in TCRDBGrid

Post by [email protected] » Mon 15 Mar 2010 11:33

Hi.

Is it possible to display, in TCRDBGrid, any custom string instead of 'NULL' value? I'd like to show, e.g text '' in cells, where is no value.

Regards,

Wojto

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Tue 23 Mar 2010 11:30

Hello

You can use the OnDrawDataCell event to define your own drawing method. In this method you should write required value to the cell if field value is NULL:
begin
if Field.IsNull then
// write required value to the cell here
else
TCRDBGrid(Sender).DefaultDrawDataCell(Rect, Field, State);
end;

[email protected]
Posts: 27
Joined: Fri 12 Feb 2010 07:44

Post by [email protected] » Mon 29 Mar 2010 07:57

It's working. Thank you for your help.

Regards

Post Reply