I have a Windows Forms application with a TabControl containing multiple TabPages. Each TabPage contains many controls whose data is read from a database via a web api. I want to be able to display at least one TabPage, with it's data, while the remaining TabPages are loading. I know I can't load a control in a thread, so I need a way to do the data retrieval in the background, concurrently, for each of the TabPages and then use the data retrieved to fill in the controls on each TabPage. So my question is: what would be the ideal method for doing this? I want to prioritize performance. I also want to have some visual indication on each TabPage header that the page is still loading. Thoughts? Ideas? Direct answers?
How can I load data for multiple TabPages concurrently in a WinForms application
303 views Asked by JNickVA1 At
1
There are 1 answers
Related Questions in MULTITHREADING
- How can I outsource worker processes within a for loop?
- OpenMP & oneTbb difference
- Receiving Notifications for Individual Task Completion OmniThreadLibrary Parallel.ForEach
- C++ error: no matching member function for call to 'enqueue' futures.emplace_back(TP.enqueue(sum_plus_one, x, &M));
- How can I create a thread in Haskell that will restart if it gets killed due to any reason?
- Qt: running callback in the main thread from the worker thread
- Using `static` on a AVX2 counter function increases performance ~10x in MT environment without any change in Compiler optimizations
- Heap sort with multithreading
- windows multithreading CreateMutex
- The problem of "fine-grained locks and two-phase locking algorithm"
- OpenMP multi-threading not working if OpenMPI set to use one or two MPI processor
- WPF Windows Initializing is locking the separated thread in .Net 8
- TCP Client Losing Connection When Writing Data
- vc++ thread constructor throwing compiler error c2672
- ASP.NET Core 6 Web API : best way to pause before resending email
Related Questions in WINFORMS
- Musical chairs: How can an asynchronous task cancel a synchronous one in c#?
- TCP Client Losing Connection When Writing Data
- how check if printing content on new page
- Find what is writing to the Output window
- WinForms, event unable to subscribe from a custom class
- A cleaner way to approach the given output
- Working with panel and moving from the second form to the the panel
- Accurately placing multiple controls in a row programmatically with dynamic table layout panel
- How to find winform application in visual studio 2022?
- How to stop comments being included in C# release build .exe
- Why is the Blazor value not immediately being rendered after changing it?
- .NET 6 Winforms separate forms control pop up freezing when unfocused and using native Windows file transfer pop up
- How to Fix C# WinForms Application Not Loading correctly on Windows 11?
- Visual Studio edit view corrupt for xaml and Winforms design views
- How to solve the problem that dragged column in datagridview too slow or miss when AllowUserToOrderColumns = true
Related Questions in BACKGROUNDWORKER
- Is it feasible to use either Task.Run or BackgroundWorker to process multiple account registrations simultaneously
- Organizing scheduled tasks or deferred work in an ASP.NET MVC application
- How to cancel BackgroundWorker and set IsBusy to false?
- Email sender worker class as a windows service isn't working .net core c#
- Failed to retrieve OIDC token from "https://login.microsoftonline.com/*/oauth2/v2.0/token"
- C# Alternative to background worker for reporting progress and COM interop?
- After Creating Celery Task It is Throwing error Model Object is not Json serializable even though It is not Creating docs in db
- Get type implementors using .NET microsoft dependency injection
- integrate webworker with axios for crud operation on data in react project
- Background worker updates aren't deleting original worker. (Android Studio - Jetpack Compose/Kotlin)
- Delayed execution of external tasks in Camunda.Worker
- Access local storage in Chrome Extension
- background worker is busy although not working
- Worker with Entity Framework repository base class
- How do I ensure cleanup of a BackgroundWorker thread in C#?
Related Questions in TABPAGE
- How to get content of sub-controls in WinForm?
- Tabpage horizontal scroll bar issue on Datagridview combobox entry event in C#
- No Anchor option for Visual Studio TabControl?
- WinForms: Trouble Switching UserControl TabPages of TabControl in Designer
- How can I disable (grey out) specific tabpage(s) of a tab control programatically in my C# form app?
- [WinForm]Combobox in Tabpage
- select tabpages in tabControl C#
- Tabpage that opens by menustrip button, but closes by the image on the tabpage header
- How can I load data for multiple TabPages concurrently in a WinForms application
- Img in custom TabPage WinForms
- Programmatically selecting an existing TabPage in a TabControl shows a blank page
- XAMARIN Selecting Tab in Tabpage through PRISM
- Allow Mouse Wheel scroll on a TabPage Control
- How to display deserialized Json result on Winform tabPage in C#
- How does OpenEdge Progress-4GL work with ActiveX tabstrip component?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
You can load data in parallel threads and just after loading data completed, then update UI (legally) by calling
Invokemethod to prevent cross-thread exception. You can also load data using tasks in parallel, and update data when each task is completed.In the following examples, the data is loading in parallel threads and as soon as each thread/task is done, the UI will be updated.
Example 1 - Using Task to load data into UI in parallel
Example 2 - Using Thread to load data into UI in parallel
NorthwindClient - Common code for both examples
Both above examples rely on the following code to load data: