How can I use a mask in a Tstringgrid 
Author Message
 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.



Thu, 12 Feb 2004 21:23:45 GMT  
 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 {*filter*} 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


Quote:

>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



Fri, 13 Feb 2004 02:34:22 GMT  
 How can I use a mask in a Tstringgrid

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



Fri, 13 Feb 2004 04:55:10 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. It's not bad canned meat...

2. Using a mask (picture) on a database set

3. Copying cells from a TStringGrid to TDBGrid

4. Separate colors for each TStringGrid cell

5. TStringGrid

6. Controls in TStringGrid

7. Components in TStringGrid

8. TStringGrid and Cell Unions

9. TStringGrid and Cell Unions

10. TStringGrid: Cell property

11. TStringGrid and RowCount

12. Hiding TStringGrid columns and TabNotebook pages.

 

 
Powered by phpBB® Forum Software