Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

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.
0
Diono
Asked:
Diono
  • 2
1 Solution
 
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
 
Arturo HernandezCommented:
after you active or run the query try doing

dbgrid1.refresh;

or

form1.update;
form1.refresh;
0
 
ITugayCommented:
vainas,
If Diono has that problem regarding NT, then it doesn't help. Beleave me.
----
Igor.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now