![]() |
Datenbank: ABS-db • Version: 5.12 • Zugriff über: ABSQuery
DisplayFormat+TStringGridanzeige
Hallo,
im AfterOpen der Query habe ich den Code:
Delphi-Quellcode:
Dieser bewirkt leider nicht die gewünschte Anzeige des Betrages mit Nachkommastellen.
with DataSet.FieldByName('VKnetto') as TNumericField do
DisplayFormat := '#.###.##0.00'; Wer hilft bitte? Gruß Lombi |
Re: DisplayFormat+TStringGridanzeige
Hallo Lombi,
nur der erste Punkt wird als Dezimaltrennzeichen erkannt:
Delphi-Quellcode:
Freundliche Grüße
with DataSet.FieldByName('VKnetto') as TNumericField do
DisplayFormat := '#,###,##0.00'; |
Re: DisplayFormat+TStringGridanzeige
Danke marabu,
aber im Grid steht immer noch 1 statt 1,00 Wie bitte löse ich das? |
Re: DisplayFormat+TStringGridanzeige
Wenn das Eingabefeld den Fokus hat, dann wird EditFormat statt DisplayFormat nicht verwendet.
Hast du den Cursor mal in ein anderes Feld gesetzt? |
Re: DisplayFormat+TStringGridanzeige
Ja, das habe ich.
Bei mir findet keine direkte Eingabe im Grid statt. Vielleicht hängt das mit onDrawCell des Grids zusammen? |
Re: DisplayFormat+TStringGridanzeige
Zitat:
|
Re: DisplayFormat+TStringGridanzeige
In der ABSTabelle ist alles richtg dargestellt, im Grid werden die Nullen unterschlagen!
Also muß im OnDrawCell des Grid noch irgendetwas für DisplayFormat hinzugefügt werden. |
Re: DisplayFormat+TStringGridanzeige
Wie zeichnest du die Zellen?
|
Re: DisplayFormat+TStringGridanzeige
Delphi-Quellcode:
...
// Zelle einfärben if (ARow < FixedRows) or (ACol < FixedCols) then Canvas.Brush.Color := clBlue else if (ARow = Row) and (ACol >= FixedCols) then Canvas.Brush.Color := clYellow else Canvas.Brush.Color := clWhite; Canvas.FillRect(Rect); |
Re: DisplayFormat+TStringGridanzeige
Ruf mal die default Drawmethode auf.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:27 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz