dynamic formatting in grid control 
Author Message
 dynamic formatting in grid control

I'm trying to find a good way to dynamically format individual cells in
a grid.  The columncount prop of the grid is -1 since I don't know how
many columns will be returned by the SQL/CURSOR which is the
recordsource of the grid.  I'm attempting to iterate through the columns
and rows of the grid, searching for the occurance of 'N' or '?',
coloring these entries using one of several schemes.  A code snip is
below, but 'Value' prop isn't available to check at runtime.  Can anyone
offer suggestions?

-----------------------------------------------------------

FOR i = 5 TO THIS.ColumnCount
                        *THIS.Columns(i).dynamicforecolor =
"RGB(255,0,0)"                && red

        FOR j = 1 TO THIS.Columns(i).ControlCount
                THIS.Columns(i).Controls(j).DynamicForeColor =
IIF(ALLTRIM(THIS.Columns(i).Controls(j).Value) = 'N', RGB(192,192,192),
RGB(0,0,0))

        ENDFOR

ENDFOR
oGrd.Refresh

---------------------------------------------------------

A second, perhaps tricky problem I need to try to find a solution for is
that I want to be able to insert a 'checkmark' image anywhere I find a
'Y' in the same grid.  The only thing I can think of rightoff is to
create an image control on-the-fly as I find those entries.

Any help is appreciated.  Thanks!

Mark

Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.



Fri, 23 Nov 2001 03:00:00 GMT  
 dynamic formatting in grid control
The column header is contained within the column itself and has no value
property. Your code should work, but you'll need to check for the header
control and bypass the value check.

--
William Fields
US Bankruptcy Court
Phoenix, AZ


Quote:
> I'm trying to find a good way to dynamically format individual cells in
> a grid.  The columncount prop of the grid is -1 since I don't know how
> many columns will be returned by the SQL/CURSOR which is the
> recordsource of the grid.  I'm attempting to iterate through the columns
> and rows of the grid, searching for the occurance of 'N' or '?',
> coloring these entries using one of several schemes.  A code snip is
> below, but 'Value' prop isn't available to check at runtime.  Can anyone
> offer suggestions?

> -----------------------------------------------------------

> FOR i = 5 TO THIS.ColumnCount
>                    *THIS.Columns(i).dynamicforecolor =
> "RGB(255,0,0)"           && red

>    FOR j = 1 TO THIS.Columns(i).ControlCount
>            THIS.Columns(i).Controls(j).DynamicForeColor =
> IIF(ALLTRIM(THIS.Columns(i).Controls(j).Value) = 'N', RGB(192,192,192),
> RGB(0,0,0))

>    ENDFOR

> ENDFOR
> oGrd.Refresh

> ---------------------------------------------------------

> A second, perhaps tricky problem I need to try to find a solution for is
> that I want to be able to insert a 'checkmark' image anywhere I find a
> 'Y' in the same grid.  The only thing I can think of rightoff is to
> create an image control on-the-fly as I find those entries.

> Any help is appreciated.  Thanks!

> Mark

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.



Tue, 27 Nov 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to control display format in a grid

2. Grid Control - Formatting Problem

3. dynamic textbox control source

4. dynamic textbox control source

5. Dynamic access to controls on a Form!

6. dynamic textbox control source

7. Problem with dynamic filter in a grid

8. Dynamic Grid / Columns and Code Problem

9. Performance issues with Dynamic properties in Grid -- VFP5

10. Problems with dynamic grid properties

11. Dynamic Value in Grid - How ?

12. Grid with dynamic .BMP's

 

 
Powered by phpBB® Forum Software