I am using TDBAdvGrid Version 2.5.1.9 with:
Pagemode = False
SortSettings.Show = True (rest default)
Sorting on all columns works fine except an amount column which is a calculated field.
Most rows are on the correct place, but some not.
Is there anything that I can do, or is this a known problem?
I could not reproduce this here so far.
Do you see any pattern on the rows not sorted correct?
Can this be due to mismatch between thousand/decimal separator used in the app versus the one returned/set by the DB field?
The decimal seperator is not set in the app, but is , (comma) Dutch in the Windows settings.
The users need to enter 1125,75 for 1.125,75.
Where can I find the settings of the DB field?
I used on the databasefield the DisplayFormat '#,##0.00'. That made the trouble to exist.
When I changed it to '0.00' the sorting worked fine again.
What need I to do, to get the sorting correct and to show the thousand separator again?
Can you try to implement for these columns the event grid.OnGetFormat with something like:
procedure TForm1.AdvStringGrid1GetFormat(Sender: TObject; ACol: Integer;
var AStyle: TSortStyle; var aPrefix, aSuffix: string);
begin
if ACol in AMoneyColumn then
AStyle := TSortStyle.ssFinancial
end;