Delphi DBGrid - Tick symbol in Boolean field

327 Views Asked by At

I have 3 bit fields (in MSSQL) which I use to denote a YES, MAYBE, NO answer from the User. Rather than the fields just showing as 0 or 1 I've created calculated fields so they show 'YES', 'MAYBE' or 'NO' strings, which is much better visually but still not quite right (e.g.ascii showing a 'YES' in the 'NO' field is a bit odd).

But what would be a lot better is if a 1 value was shown as a tick, and a 0 value shown as a cross.

I've toyed with the TBooleanField(table.fieldbyname('YES')).DisplayValues:= ascii code but can't get a correct value - in the ASCII/ANSI codes I've looked up I can't see a tick symbol or find the codes for these and when I use some of the codes to test different characters are displayed. I think I'm missing something here?

Any thoughts would be a help.

1

There are 1 best solutions below

0
Bazzer On

added: const TICK = #$2713; //a tick symbol

then

TBooleanField(dm.vEnrolments.FieldByName('YES')).DisplayValues := TICK;

And it works fine.

#10003 & #10005 work fine as well, thanks ...