Solved

DBGrid not refreshing ...

Posted on 2000-04-21
4
380 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
  • 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 80 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
System restore point 4 91
delphi exception 7 62
add combobox item based on numbers 9 122
Create a path if not exists 7 69
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now