简体   繁体   中英

Delphi Livebindings, Grid shows (BCD)

trying to implement a query viewer in FMX Windows, which allows user to write a query and display its results.

the problem at hand is with fields of type Currency (or BCD, depending on the database), which is being rendered into the grid as "(BCD)" as shown below:

输出

this question describes the exact same problem, specifically for FireDAC users. For the sake of trying, using FireDAC, the amounts in Currency fields are displaying correctly.

However, I am not using FireDAC. In fact, I am not using one specific set of DACs, as it varies with the underlying database in use.

I checked the options available in TBindSourceDB, the grid itself, but none would render the amounts correctly.

Any suggestions on solving this (other than converting the application to VCL and using a TDBGrid)?

Edit:

Delphi 10.3

DAC: TADSTable (Advantage), TEDBTable (ElevateDB) to name a few

MVCE: not much coding to share here, just drop 2 components, a TGrid and a data-access-component mentioned above (with a Currency field), link them up via visual livebindings and that's it.

came back to this problem after a few months, and managed to resolve it, so here's how it worked:

Removed the TGrid, and used a TStringGrid instead. Now the livebindings are able to render fields of type Currency without any extra manual configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM