I'm trying do change the display mode of content in a grid binded to a database table in firemonkey. The only method is through CustomFormat but no luck in making folowing:

I'm trying do change the display mode of content in a grid binded to a database table in firemonkey. The only method is through CustomFormat but no luck in making folowing:
1. On editing Currency column the DecimalSeparator is "," but in some situations (based on regions) it is "." , so I need to catch that "." and change it to "," like I do in TEdit.OnKeyDown.
2. The currency is displayed rounded to 2 decimals, I need to have 5 decimals.
How can that be done?
And another question: is it possible to change in Firemonkey the StringGrid design (borders, lines, background, etc., columns, rows, cells) ?

Comments

  1. Attila Kovacs I don't want to change the locale, just catch the "." When it is pressed in the cell and change it to ",". I do smth like that in edit boxes, but no luck in stringgrid.

    ReplyDelete
  2. In the VCL old way, you had to write an OnKeyPress event, there you can intercept any key, and do whatever you want with that key. But I will discourage this, it is a really bad idea. Maybe it works with FMX, still a bad idea.

    ReplyDelete
  3. So, any ideea?
    If there is no a solution for having a OnKeyPress in a StringGrid Cell, I'm thinking to display a TEdit box over the the cell and do that interception there.

    ReplyDelete

Post a Comment