Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Barbara Peisch
  Where is Barbara Peisch?
 Oceanside
 California - United States
 Barbara Peisch
 To: Russell Hill
  Where is Russell Hill?
 Sydney
 Australia
 Russell Hill
 Tags
Subject: RE: Grid zeros
Thread ID: 188908 Message ID: 188976 # Views: 1 # Ratings: 1
Version: Visual FoxPro 9 Category: Grids
Date: Tuesday, August 12, 2008 8:52:30 PM         
   


Mustapha is correct that you need to use the "Z" in the format property. But if you've left the column's Sparse property set to .T., then you need to set the Format property to "Z" in both the column and the textbox in the column.

The reason for this is that with Sparse set to .T. (the default) you see the colum itself when the cell doesn't have focus and you see the textbox when the cell has focus.

> Hi all,
>
> When I use the following SQL SELECT as the source for a Grid, I get many zero values associated with CLAIM.
>
>
SELECT KEYID, NAME, WEIGHT, ALLOWANCE AS CLAIM, GROUPDEF ;
>   FROM &client_filename ;
>  WHERE CLIENTKEY = get_client ;
>   INTO CURSOR TempCursor

> By that I mean that the CLAIM column of the Grid might appear as follows:
>
>
....	CLAIM	....
> ....	  0.0	....
> ....	 -1.5	....
> ....	  0.0	....
> ....	  0.0	....
> ....	  0.0	....
> ....	 -2.0	....

> I want these 0.0 values to appear as "blanks", much like they do in Excel if Tools .. Options .. Zero Values is unchecked.
>
> I can get the required result by altering the SQL SELECT as follows:
>
>
SELECT KEYID, NAME, WEIGHT, IIF(ALLOWANCE=0,SPACE(4),STR(ALLOWANCE,4,1)) AS CLAIM, GROUPDEF ;
>   FROM &client_filename ;
>  WHERE CLIENTKEY = get_client ;
>   INTO CURSOR TempCursor

> but I would prefer to solve the issue at the Grid level if possible.
>
> Is there any property of a Grid I can use? If not, is there any way other than altering the SQL SELECT?
>
> Thanks,
>
> Russell.



-BP
www.peisch.com

ENTIRE THREAD

Grid zeros Posted by Russell Hill @ 8/12/2008 3:20:14 PM
RE: Grid zeros Posted by Mustapha Bihmouten @ 8/12/2008 3:31:26 PM
RE: Grid zeros Posted by Russell Hill @ 8/12/2008 11:40:26 PM
RE: Grid zeros Posted by Samir Ibrahim @ 8/12/2008 3:34:54 PM
RE: Grid zeros Posted by Mustapha Bihmouten @ 8/12/2008 3:43:22 PM
RE: Grid zeros Posted by Samir Ibrahim @ 8/13/2008 9:42:28 AM
RE: Grid zeros Posted by surinder singh @ 8/12/2008 3:51:16 PM
RE: Grid zeros Posted by Mustapha Bihmouten @ 8/12/2008 4:06:57 PM
RE: Grid zeros Posted by Samir Ibrahim @ 8/13/2008 10:12:28 AM
RE: Grid zeros Posted by Samir Ibrahim @ 8/13/2008 10:29:08 AM
RE: Grid zeros Posted by Barbara Peisch @ 8/12/2008 8:52:30 PM
RE: Grid zeros Posted by Russell Hill @ 8/12/2008 11:40:00 PM