Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating DBGrid Fields Realtime?

Status
Not open for further replies.

FallNAngel

Programmer
Mar 4, 2002
5
PK
I'm working on making an auction manager and one of the fields is how much time is left in the auction (Ending Date/Time - Current Date/Time). I would like to have the fields updated on the Grid realtime, but I'm kinda stumped on how to get this all displayed correctly. The closest I can get is having it update whenever you switch to a new record, but that's it. Any help would be appreciated, thanks!
 
I don't know about real time but you could set up a timer that will update the grid every few seconds. Best to do this is a thread, though.
James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
Thanks for the reply. Putting to work a TTimer wouldn't be too hard, but last time I had tried this I did it I just used a for loop to go through all the records, updating the field and calling the Update() method.

Of course, I ran into a problem with this. Say the form is only so big as to allow 20 records to be shown on the grid. To see more than 20, you'd have to use the scroll bar and scroll down. Since I was actively selecting the next record, this would cause the DBGrid to "scroll" down through the records cancel any changes being made. Am I going about this the wrong way?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top