Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 701833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:39:14+00:00 2026-05-14T03:39:14+00:00

Actually i am using the AsyncCalls library to execute an Query asynchronously in this

  • 0

Actually i am using the AsyncCalls library to execute an Query asynchronously in this way.

       while AsyncMultiSync([RunQuery], True, 10) = WAIT_TIMEOUT do
       begin
            FrmProgress.refresh; //Update the ellapsed time in a popup form
            Application.ProcessMessages; 
       end;

and everything works ok.

Now i want to do the same for load the query in a grid.

so i tried this

         while LocalAsyncVclCall(@InitGrid, 10) = WAIT_TIMEOUT do
         begin
              FrmProgress.refresh;
              Application.ProcessMessages;
         end;

but obviously not compile because the type returned by LocalAsyncVclCall is IAsyncCall and not a Cardinal.

also i tried this, but not works because the initgrid procedure is executed but not asynchronously.

             while not LocalAsyncVclCall(@InitGrid, 10).Finished do
             begin
                  FrmProgress.refresh;
                  //Application.ProcessMessages;
             end;

How i can use LocalAsyncVclCall or another function to execute an VCL code asynchronously .

i want something like this.

             while ExecuteMyVCLProcedure(@InitGrid) = WAIT_TIMEOUT do
             begin
                  FrmProgress.refresh;
                  //Application.ProcessMessages;
             end;

UPDATE
The InitGrid procedure goes here, the TcxGrid does not provide any event to show the progress of the data load. because that i want to execute this procedure asynchronously.

procedure InitGrid;   
begin
  cxGrid1DBTableView1.BeginUpdate;
  try    

       cxGrid1DBTableView1.DataController.DataSource:=DataSource1;//in this point assign the query previously executed to the grid. 

       cxGrid1DBTableView1.ClearItems;
       cxGrid1DBTableView1.DataController.CreateAllItems;

       for ColIndex:=0 to cxGrid1DBTableView1.ColumnCount-1 do
       cxGrid1DBTableView1.Columns[ColIndex].Options.Editing:=False;

  finally
    cxGrid1DBTableView1.EndUpdate;
  end;

end;

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:39:14+00:00Added an answer on May 14, 2026 at 3:39 am

    UPDATE The InitGrid procedure goes
    here, the TcxGrid does not provide any
    event to show the progress of the data
    load. because that i want to execute
    this procedure asynchronously

    You can’t populate the cxGrid in a different VCL thread because there is only one VCL Thread, the MainThread. Calling LocalAsyncVclCall from the MainThread does nothing else than executing the given function in the thread that calls LocalAsyncVclCall. So it wouldn’t do anything different than calling the InitGrid() function in the same thread where your ProcessMessages() call is. Hence ProcessMessages() would be called after the data was loaded into the cxGird what is not what you want.
    All the *VclCall() functions are intended to be executed from a different thread than the MainThread.

    Without changing the cxGrid’s code to support a “progress event” you are out of luck with your attempt.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.