Link to home
Start Free TrialLog in
Avatar of Diono
Diono

asked on

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.
Avatar of Igor UL7AAjr
Igor UL7AAjr
Flag of Kazakhstan image

It seems you have NT? Try it under W95 or W98. Is it different?
;)
-----
Igor
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.
ASKER CERTIFIED SOLUTION
Avatar of Arturo Hernandez
Arturo Hernandez
Flag of Mexico image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
vainas,
If Diono has that problem regarding NT, then it doesn't help. Beleave me.
----
Igor.