Page 1 of 1

NULL representation in TCRDBGrid

Posted: 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

Posted: Tue 23 Mar 2010 11:30
by bork
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;

Posted: Mon 29 Mar 2010 07:57
It's working. Thank you for your help.

Regards