Is it still impossible/dangerous to use AsyncFetch with Async Fetch Enabled???
I know about http://www.devexpress.com/Support/Center/p/DQ7728.aspx
and http://www.devexpress.com/Support/Center/p/CB41565.aspx
Are there Limitations when using the grid just for displaying data
most of the SQL-tables that have got a very high count of rows are only needed for viewing
so it would be a great option to be able to enable AsyncFetch for a ReadOnly cxGrid
thenk you
Bernhard Hartl
We have closed this ticket because another page addresses its subject:
Working with TcxCustomDataController in separate threadcxGrid and Async Fetch
Answers
Hello Bernhard.
Thank you for your message.
Unfortunately, this limitation still persists due to architectural peculiarities of our components. However, we have a corresponding suggestion in our Support Center. Please refer to the Working with TcxCustomDataController in separate thread report for additional information. You can start tracking this issue to stay informed on our progress with it.
Best regards,
Ingvar.
Thank you for your clarification. It seems that in your scenario this is indeed the best approach.
As an alternative solution to visually lock the UI, you can try the TcxGrid.LockedStateImageOptions properties set. In combination with the BeginUpdate and EndUpdate methods these properties can produce some visual effects to inform an end-user that update is in progress.
Hello Paulo
I did create the Async Refresh that way - it works fine
but there is one problem…
when the MemDataset is modified - cxGrid.Datacontroller stalls the main thread for several seconds
To hide that MemDataset Update from the user I have to use
MemDataset.DisableControls;
UpdateMemDataset;
MemDataset.EnableControls;
or
cxGridView.BeginUpdate;
UpdateMemDataset;
cxGridView.EndUpdate;
MemDataset.EnableControls or cxGridView.EndUpdate causes cxGrid.Datacontroller to stall the main thread for several seconds
is there any way to avoid that stall???
Ideas:
is there any way to decouple GridView from the DataController
Update the DataContoller in the Background-Thread
and couple GridView again to the datacontroller
or to clone the Datacontroller
Update the cloned DataContoller in the Background-Thread
couple GridView to the cloned datacontroller
Free the old Datacontroller
or something like that
I am simply searching for a way - how to update the datacontroller in the background to minimize the stall-time of the main thread as much as possible
Thank you
Bernhard Hartl
Hello Bernhard,
Our Data Controller does not support this functionality. Theoretically, you can directly access its inner storage (the protected DataStorage property) and its records by using their pointers from a secondary thread. However, this approach is not tested and I suggest that you carefully test results before using it. In fact, we already have a special helper class to perform this access. However, we do this in the main thread (see the cxDBTL.pas unit). If you decide to try this approach, take a look at the TcxDataStorageHelper class in the cxDataStorage.pas unit.
I hope this information will be of help.