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



Thanks, I will incorporate TADODataset here as well.

(This is the first time I try to ADO an Excel workbook and got the coding from a sample)

regards Sven

"Bob Swart" <Bob@xxxxxxxxxx> wrote in message news:480A16E6.6020102@xxxxxxxxxxxxx
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

.