Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grid refrech problems

Status
Not open for further replies.

friend01

Programmer
Jun 4, 2009
94
CA
Hi Y'All,

I have the following problem. I have a problem with my grid which is not refreshing properly for some reason. Here is my specs (vfp8). When a user changes the values in the dbf the newly displayed values in the cells appear in the grid with no problems at all, however, it seems that the 'dynamicbackcolor' and 'dynamicbackcolor' don't refresh themselves properly. This is what I have in the dynamicbackcolor fx "="IIF(tticket.needupd, RGB(255,255,0), RGB(255,255,255))""

I also have a 'timer' in my form which does the following:

GO top
THISFORM.grid1.REFRESH()
every 5000 milliseconds

Any reason why the the dynamicbackcolor does not refresh itself properly but the value in the cells do? Any ideas on what to do ensure that the dynamicbackcolor gets executed?

I'm at my wits end. Please help

Thanks,
F1
 
Put this in the grids refresh

This.SetAll("dynamicbackcolor", "IIF(tticket.needupd, rgb(255,255,0), RGB(255,255,255))", "Column")

and rather than use a timer,From where ever you are changing values in the DBF, from there call

THISFORM.grid1.REFRESH()

 
the values of the .dbf are changed thru another program that kinda realtes to this one so I can't really put THISFORM.grid1.REFRESH() in this program.

BUT why would the values in the grid cells (which are the dbf values) change perfectly and get updated instintanitely but the "dynamicbackcolor" and dynamicforecolor and dynamicfontboldcolor values not get updated???

this is what I have in my 'properties' of my grid1:

dynamicbackcolor
="IIF(tticket.needupd, RGB(255,255,0), RGB(255,255,255))"

dynamicfontboldcolor
IIF((TTICKET.NEEDUPD)=.T.,.T.,.F.)

dynamicforecolor
="IIF(tticket.needupd, RGB(223,0,0), RGB(0,0,0))"

why wouldn't the grid refresh itself as needed as per the values above? Also, I have this in another timer (updating every 10 seconds):

IF TIME()>=h3
REPLACE needupd WITH .T.
IF tticket.sentremail =.F.
DO updemail
REPLACE tticket.sentremail WITH .T.
ENDIF
ENDIF


An FYI, I know that tticket.sentremail =.F. becuase .f. because the other fields in between that replace gets done and the cells get updated in the grid.


A strange occorance is that the dynamicforecolor, dynamicfontboldcolor, dynamicforecolor do refresh themsleves most of the time and work properly. It's only sometimes that it doesn;t work properly which seems odd.

What's up with these dynamicforecolor, dynamicfontboldcolor, dynamicforecolor properties. Finally, is there a way to force them to refresh or something becuase it doesn;t make sense to me.


thanks,
f1




 
Dynamicbackcolor etc happen once after the data gets loaded, Just put these in the INIT() etc is not enough, It has to be done by the program every time the field values change.
If you put what I posted in the Refresh of the grid and whenever the value changes do an explict refresh() either within the above timer code, etc, does not matter where, it will work
 
Actually another weird question is why do I have to put the

=" " (equals and quotes)

in front and at the end of the dynamicforecolor & the dynamicbackcolor but not the dynamicbold??? any reason why that is?

What seems to be the problem (from what I can tell) (and I don't know where it's coming from is that the tticket.needupd field gets reset to .t. for some reason and therefore the triggers aren't happening.

An FYI, I don't know when the value changes that's why I have a timer that has :
GO top
THISFORM.grid1.REFRESH()
every 5000 milliseconds

why would the dynamic properties work sometimes and not others? Also, why would the tticket.needupd field go back to .t.?

any ideas?

thanks,
f1

 
could it have anythign to do with sparse property? I'm just shooint in the dark here. please help
 
Are you a programmer?

Regarding = "", thats just the way it is...

Regarding why the needupd is changing to .t., your code is doing it...

IF TIME()>=h3
REPLACE needupd WITH .T.
****
****
ENDIF

 
Yes, I am a programmer.

With reagds to my code mentioned:

IF TIME()>=h3
REPLACE needupd WITH .T.
****
****
ENDIF

TIME() is NOT greater than or equal to h3 so it should not be doing that replace. any other reason why it goes from .f. to .t. ?


any help would be greatly ap;precaited.

thanks,
f1

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top