TDBAdvGrid FireDAC sorting TCurrencyField

Dear TMS Software,

We are using a TDBAdvGrid connected to a datasource connected to a TFDQuery component.  When sorting is turned on and paging is turned off in TDBAdvGrid, everything seems to work great except for columns of type TCurrencyField.  These columns are sorted alphabetically instead of by their numeric value.

Is there something I need to turn on to have this work; is this a bug and planned to be fixed; or do I need to override some method and provide to the grid a sorting algorithm for columns of TCurrencyField type?

Thanks for any help and for a great component,


Not sure how your currency field formats its value but I suspect that for the formatting you use, TDBAdvGrid doesn't automatically recognize it is a numeric value. Try using the event OnGetFormat() to force the grid to recognize for this particular column the number as ssFloat. In case there is a currency prefix or suffix, you'll also need to specify this in the OnGetFormat event handler.

Hi Bruno,

Thank you for the quick answer. I will give it a try. I have not provided any special formatting to the TCurrencyField. I might be with looking into for the default US locale. Our app shows it formatted as:


Thanks again. Great support.


Reporting back...  This gets my currency sorting correctly:

void __fastcall TMainForm::resultGridGetFormat(TObject *Sender, int ACol, TSortStyle &AStyle,
 UnicodeString &aPrefix, UnicodeString &aSuffix)
if ((*resultGrid->Columns)[ACol]->Field->DataType == Data::Db::ftCurrency) {
AStyle = ssFinancial;
aPrefix = "$";

Thank you for the help,


For the given currency format, this indeed is the correct instruction to have the sort format correct.