Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DBGrid not refreshing ...

Posted on 2000-04-21
4
Medium Priority
?
390 Views
Last Modified: 2011-04-14
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
Comment
Question by:Diono
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:ITugay
ID: 2739550
It seems you have NT? Try it under W95 or W98. Is it different?
;)
-----
Igor
0
 

Expert Comment

by:chumba
ID: 2739862
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
 
LVL 1

Accepted Solution

by:
Arturo Hernandez earned 240 total points
ID: 2744285
after you active or run the query try doing

dbgrid1.refresh;

or

form1.update;
form1.refresh;
0
 
LVL 9

Expert Comment

by:ITugay
ID: 2746657
vainas,
If Diono has that problem regarding NT, then it doesn't help. Beleave me.
----
Igor.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question