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 520107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:06:37+00:00 2026-05-13T08:06:37+00:00

brief history. I have a little reporting tool that I am creating that uses

  • 0

brief history. I have a little reporting tool that I am creating that uses a backgroundWorker to do the reporting. Works great, the GUI updates nicely and reports what I want it to.

However if I get a lot of results back and then try to update my ListView control the GUI hangs while it is adding all of the ListViewItems. I would like to provide the user with some feedback while this is going on to let them know that the app is still working but can’t seem to figure it out.

I have tried to update the ListView from within the BackgroundWorker and of course got the Cross Thread error.

I tried to create a new ListView from within the BackgroundWorker.DoWork and that worked up until I tried to add the ListView to the GUI in the BackgroundWorker.RunWorkerCompleted, and received the Cross Thread error.

I tried to update the ListView from the BackgroundWorker.RunWorkerCompleted and this is where the GUI hangs (actually turns white), I even created a progress window, and it does the same thing. Once the adding of the ListViewItems is complete the application returns to normal and works fine.

Does anyone have any thoughts?

Thanks
Patrick

  • 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-13T08:06:38+00:00Added an answer on May 13, 2026 at 8:06 am

    You should add items to the ListView on the UI thread in RunWorkerCompleted.

    You should call the ListView’s BeginUpdate method before adding the items, then call EndUpdate afterwards. This should make it substantially faster.

    To make it even faster, you should make an array of ListViewItems, then call AddRange with the entire array.
    If you do this, you don’t need to call BeginUpdate or EndUpdate, since AddRange will call them for you.

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

Sidebar

Related Questions

Here's a brief rundown of my issue: I have a JavaScript function that gets
Brief Story: I have a Servlet which receives a request (getContentType() = audio/x-wav) that
The brief synopsis is that I would like to have my Windows 8 application
Brief Explanation I am unsure about the structure that I have used for this
If you look at my brief history of questions, I've seem to have built
Brief Description of the app: I have written a Delphi application that allows a
Brief introduction: I have this ASP.NET Webforms site with the particularity that it doesn't
Brief history: I'm writing a stored procedure to support a legacy reporting system (using
Brief : I have code which works if I don't dispose of the BindingSource
In brief, we have a website built in asp.net c# that we're adding a

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.