Board index » delphi » How can I use a mask in a Tstringgrid

How can I use a mask in a Tstringgrid

Hi

I use a stringgrid to show fields from a TTable
When I show a currencyfield in a stringgrid I want a RightAlignment
and a decimalpoint (Mask 0.00)  at all times
The stringrid is used  Readonly.
OnEditMask does not give me a solution

 StringGrid4.Cells[4,row]:=floattostr(Table1PRICE.Value);  
How can I mask the Cell?  
Thanks
Frits v/d laan
NL.

 

Re:How can I use a mask in a Tstringgrid


Frits,
Have you tried doing the formatting in the TField object for this
field rather than in the StringGrid? Being a float field may force
some more {*word*118} approach. One thing that comes to mind would be to
use a calculated field in the table and do the conversion in the
OnCalcField event.

HTH,
Dan

On Sun, 26 Aug 2001 13:23:45 GMT, f.vd.l...@inter.nl.net (Frits v/d

Quote
Laan) wrote:
>Hi

>I use a stringgrid to show fields from a TTable
>When I show a currencyfield in a stringgrid I want a RightAlignment
>and a decimalpoint (Mask 0.00)  at all times
>The stringrid is used  Readonly.
>OnEditMask does not give me a solution

> StringGrid4.Cells[4,row]:=floattostr(Table1PRICE.Value);  
>How can I mask the Cell?  
>Thanks
>Frits v/d laan
>NL.

--
Dan Brennand
CMDC systems, inc.
Configuration Management and Document Control:
visit us at www.cmdcsystems.com
[SPAM block: change at to @ in my e-mail address]

Re:How can I use a mask in a Tstringgrid


In article <3b88efed.9679...@news.inter.nl.net>, f.vd.l...@inter.nl.net (Frits

Quote
v/d Laan) writes:
>I use a stringgrid to show fields from a TTable
>When I show a currencyfield in a stringgrid I want a RightAlignment
>and a decimalpoint (Mask 0.00)  at all times
>The stringrid is used  Readonly.
>OnEditMask does not give me a solution

Ther is a comprehensive answer  using OnDrawCell to this type of stringgrid
problem, which I posted in the "Alignment of numbers in a StringGrid" thread in
comp.lang.pascal.delphi.misc on 23 Aug.

Alan Lloyd
alangll...@aol.com

Other Threads