I noticed a nice behavior in my application. I have a devexpress quantum grid (somehow a powerful TDBGrid), it is linked with a TDataSource to a TMSQuery.
I try to make an example.
Imagine the TMSQuery is a SELECT * FROM CUSTOMERS.
Once the query is opened I see all the customers in the grid (Form A).
Now if from a customer detail form (Form B)i change a value (like "Devartz" to "Devart") after some seconds (usually 30-60, i cannot tell exactly how many) i see that the grid in Form A is updated ("Devartz" to "Devart").
Could you please help me in understanding how this works?
I suspect (but I am not sure) that TMSQuery every X seconds notifies all DataSources that some data has changed.
May be i am wrong, but for sure there is a reason, could you please help me in finding it?
Why a grid bound to a TMSQuery refreshed periodically?
Re: Why a grid bound to a TMSQuery refreshed periodically?
Hello,
Such behaviour can be possible only in three cases:
1) The AutoRefresh option of the DataSet is enabled - in this case, automatic refresh will occur in a time interval specified in the AutoRefreshInterval property.
2) The TMSChangeNotification component is used, and DataSet is subscribed for events on this table editing.
3) DataSet refresh is called explicitly
Such behaviour can be possible only in three cases:
1) The AutoRefresh option of the DataSet is enabled - in this case, automatic refresh will occur in a time interval specified in the AutoRefreshInterval property.
2) The TMSChangeNotification component is used, and DataSet is subscribed for events on this table editing.
3) DataSet refresh is called explicitly
Re: Why a grid bound to a TMSQuery refreshed periodically?
Thank you.
In fact i found Options.AutoRefresh = True
only on one TMSQuery.
Could you please eplain me how it works internally? Is the TMSQuery.SQL executed again every autorefreshinterval seconds?
In fact i found Options.AutoRefresh = True
only on one TMSQuery.
Could you please eplain me how it works internally? Is the TMSQuery.SQL executed again every autorefreshinterval seconds?
Re: Why a grid bound to a TMSQuery refreshed periodically?
Hello,
You can find detailed information about the autorefresh property functioning in the help: http://www.devart.com/sdac/docs/devart_ ... efresh.htm
You can find detailed information about the autorefresh property functioning in the help: http://www.devart.com/sdac/docs/devart_ ... efresh.htm
Re: Why a grid bound to a TMSQuery refreshed periodically?
Thank you, i realize from here
http://www.devart.com/sdac/docs/index.h ... efresh.htm
that Refresh retrieves all the data.
Thanks for support.
http://www.devart.com/sdac/docs/index.h ... efresh.htm
that Refresh retrieves all the data.
Thanks for support.
Re: Why a grid bound to a TMSQuery refreshed periodically?
Hello,
Yes, the Refresh method rereads all the data, in contrast to the RefreshQuick method.
Yes, the Refresh method rereads all the data, in contrast to the RefreshQuick method.