Board index » delphi » Refreshing periodically DBGrid with TTable ?

Refreshing periodically DBGrid with TTable ?

Delphi 1 :

On a multi-user application, I need to refresh periodically (3 or 4
seconds) the DBGrid so that everybody can see the changes the others
made. But if I use a Timer to call Table.Refresh, I am not able to
suspend it when the user edits a field (DataSource.State don't match
and events don't happen when they should).

Does anybody have an idea ?

Thanks.

---------------
Vincent MORELLE
b...@calva.net
---------------
http://www.iap.fr/saf (Socit Astronomique de France)

 

Re:Refreshing periodically DBGrid with TTable ?


In article <324dc18c.728...@news.calvacom.fr>, From
b...@calvanet.calvacom.fr (Vincent Morelle), the following was written:

Quote
> On a multi-user application, I need to refresh periodically (3 or 4
> seconds) the DBGrid so that everybody can see the changes the others
> made. But if I use a Timer to call Table.Refresh, I am not able to
> suspend it when the user edits a field (DataSource.State don't match
> and events don't happen when they should).

> Does anybody have an idea ?

> Thanks.

In your timer how about checking for the state of the table:

if MyTable.State = dsBrowse then
    MyTable.Refresh;

That way it will only refresh when the user is browsing.

God Bless,

--
Jay Schwisow j...@weldnet.com
09/29/96 19:20
---------
Using: OUI PRO 1.5.0.2 from http://www.dvorak.com

Re:Refreshing periodically DBGrid with TTable ?


Quote
j...@weldnet.com (Jay Schwisow) wrote:
>In article <324dc18c.728...@news.calvacom.fr>, From
>b...@calvanet.calvacom.fr (Vincent Morelle), the following was written:
>> On a multi-user application, I need to refresh periodically (3 or 4
>> seconds) the DBGrid so that everybody can see the changes the others
>> made. But if I use a Timer to call Table.Refresh, I am not able to
>> suspend it when the user edits a field (DataSource.State don't match
>> and events don't happen when they should).

>> Does anybody have an idea ?

>> Thanks.

>In your timer how about checking for the state of the table:

>if MyTable.State = dsBrowse then
>    MyTable.Refresh;

It doesn't work : the table is in this state until the users modifies
the field. If he only moves the cursor in it, the state is dsBrowse
and the periodical Refresh periodically (!) selects all the field,
loosing the cursor position.

Another idea ?

---------------
Vincent MORELLE
b...@calva.net
---------------
http://www.iap.fr/saf (Socit Astronomique de France)

Re:Refreshing periodically DBGrid with TTable ?


In article <325315e9.9520...@news.calvacom.fr>, From
b...@calvanet.calvacom.fr (Vincent Morelle), the following was written:

Quote
>> In your timer how about checking for the state of the table:

>> if MyTable.State = dsBrowse then
>> MyTable.Refresh;

> It doesn't work : the table is in this state until the users modifies
> the field. If he only moves the cursor in it, the state is dsBrowse
> and the periodical Refresh periodically (!) selects all the field,
> loosing the cursor position.

> Another idea ?

Reseek the record after the refresh?

--
Jay Schwisow j...@weldnet.com
10/07/96 22:53
---------
Using: OUI PRO 1.5.0.2 from http://www.dvorak.com

Other Threads