DBGrid not refreshing ...

Hi guys,

I have found, what I believe to be a problem(bug), that a Lookup TField object(for a TQuery Object) does not refresh itself when declared as a field to be displayed in a DBGrid Component. When the dataset which the Lookup field uses for the lookup is changed, the underlying dataset is refreshed, but this is not reflected in the DBGrid even though I call a refresh to the dataset and DBGrid component. The Grid does refresh itself when you move the affected row off the visible canvas area. When you scroll it back into view, it has corrected itself. Any ideas?
I am using Delphi5 with the latest patch installed.

Regards,
Dion.
DionoAsked:
Who is Participating?
 
Arturo HernandezConnect With a Mentor Commented:
after you active or run the query try doing

dbgrid1.refresh;

or

form1.update;
form1.refresh;
0
 
ITugayCommented:
It seems you have NT? Try it under W95 or W98. Is it different?
;)
-----
Igor
0
 
chumbaCommented:
Are you using ADO by chance? I found that the refresh method does not work when using ADO. I simply replaced refresh with a combination of ...
   YourQueryHere.Active := FALSE;
   YourQueryHere.Active := TRUE;
....basically the exact code which the refresh method is supposed to replace.
0
 
ITugayCommented:
vainas,
If Diono has that problem regarding NT, then it doesn't help. Beleave me.
----
Igor.
0
All Courses

From novice to tech pro — start learning today.