suppose i have gridview in main thread and i want to populate datatable in another thread and populate my grid in main thread. is it possible....if yes then plzzz help me with source code.
very nice question...i want to know too...
If you want to load the data in another thread, to improve the responsiveness of the application, then you've really only two options:
1. Call the database reads in background in the code-behind. However, since you have to wait for the data before you can fill the grid you're not gaining anything; in fact you're probably harming the server resources.
2. Load the page, then asynchronously load the data. This gives the impression of a more responsive UI; the user still has to wait for the data, but they see something happening.
If you want the second approach then you have to do no data loading in the page (in chode behind), but load the page and in script, when the page has loaded in the client, create a call back to the server to get the data. You then have to extract the data and format it for display (since it's just raw data). The alternative is that you call a method that loads the data into the gridview and gets the gridview to render its HTML, then sends that back to the client. All-in-all you're giving yourself much more work that way.
can u plzz come with example code of two way. thanks