Re: Format display in DBGrid cell? (D2007 and Vista)



Hi Sven,

I had a similar situation with another program connecting to an Access database. In that program I already used TADODataset (instead of TADOQuery) and was told how to control the DBGrid display using the fielddef properties in TADODataset.

That's the usual way, with the DisplayFormat property of the field (using the fields editor at design-time, of the Fields collection at runtime, casting it to the right field type:

(field as TFloatField).DisplayFormat := '0.00';

for example.

regards Sven

Groetjes,
Bob Swart

--
Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi
CodeGear Technology Partner -- CodeGear RAD Studio Reseller (BeNeLux)
Blog: http://www.drbob42.com/blog - RSS: http://eBob42.com/weblog.xml
.