i have c# windows form when it opens it load thousands of record to fill a data table, the problem is when i click on the form it show a blank window for some time before displaying all the data, So
How do i display a wait sign on the datagridview while the data load and let the form’s other control to be visible?
how can i speed it i am ready to do threading if it does the job.
You need a background thread. You could set up a BackgroundWorker in your form, or set up a basic asynchronous model with a BeginInvoke in your event handler, which will be given another method as its callback when done. In the background worker, do all your data retrieval, and then Invoke back to the main thread when you need to actually populate the DGV (which should take much less time once the information is all in memory).
The problem is that while the main thread is busy waiting for the DB to come back with all the rows, the system cannot respond to any other user input or Windows messages (such as “redraw yourself”). Windows will see that the message queue for that app is backing up and mark the app as “not responding”. Not a very pleasant user experience.