I have it working....!
Just deleted all the fields in the field editor and re-added them, then deleted all entries in the dbgrid and re-added them and it worked fine.
Think I must have had some settings wrong from previous atempts.
Much apricated advice all, cheers Kris.
Thanks VintageWine (nice name)
That looks perfectly what I want to do.
I added all the fields to the fields editor for the table that feeds the dbgrid and added the code to the OnGetText but nothing gets displayed now, not the real field values or the string values??
You said to make the fields...
> Are the string values that define the numbers in a separate table?
No, I want to use hard code to change the numbers in to string.
The code looks good, but I dont have a OnCalcField event!?!
Im using Delphi 5, standard Dbgrid component.
Do I need to create a calculated field?
Cheers Caz.
Thanks, i tried:
if field.AsInteger = 0 then MessageDlg('ok', mtWarning, [mbOK], 0);
But no popup message is displayed.
How would you use this function is field.asinteger refering to the field number or the actual value of a field?
Cheers for the help, Kris.
Thanks would that be the DrawDataCell event of the DBgrid?
If so I have "const Rect: TRect; Field: TField;" availible to use, I could tell which field I am on using the Field varible however I cant refrence this witha string eg. If Field = 'status' then XYZ.... TField and String not compatible...
Hi ya all,
I have a DBGrid, one of the fields is an integer field.
Each integer repsents a stage or status. How do I make the DBGrid show a string instead of the integer.
eg. 1 would be replaced by "Start", 2 would be replaced by "Middle" and 3 replaced by "End".
Any help or pointers would be...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.