Ticket Q267890
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Working with TcxCustomDataController in separate thread

cxGrid and Async Fetch

created 15 years ago

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

Answers

created 15 years ago

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.

    Show previous comments (5)
    DevExpress Support Team 7 years ago

      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.

      RB RB
      Ramon Bachmeier 7 years ago

        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

        DevExpress Support Team 7 years ago

          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.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.