![]() |
|
#1
|
|||
|
|||
|
hello
how can i Display a NULL-value as "0" in my dbgrid. If the numericvalue is NULL, i want to display "0". How can i do? thanks hermann |
|
#2
|
|||
|
|||
|
why don't you update all the Null to 0 in the DB?
a simple Update query will do the job |
|
#3
|
|||
|
|||
|
Hello :-)
I suppose you can use the OnGetText event of the TField to do the job, this will affect the way the field's data is displayed in the data-aware controls. Double click or right click the TTable or TQuery and select "Fields Editor..." , select the field you want, now in the Object Inspector you should find a OnGetText event for the TField, use some code that looks something like this: if Sender.IsNull then Text := '0' else Text := Sender.AsString; You can also use the OnSetText event in a similar fashion to actually save data in any format you wish. |
|
#4
|
|||
|
|||
|
Set the DisplayFormat property for this numeric field
With best regards, Mike Shkolnik http://www.scalabium.com |
![]() |
| Thread Tools | |
| Display Modes | |
|
|