Monday, August 3, 2009

How to show progress bar while loading datagrid?

Dear frnds

I m developing a proj in which while loading a grid it takes time after clicking on btn.
So i want to show progress bar along with grid loads......?

I doubt whether it is possible...
But you can give it a try like this...
I have two methods
both are crude...

Method 1 :
Start the progress bar tick when you click the button and end the progress bar tick when the loading of the procedure stops...

Method 2 :
Use data reader
to retrieve and on each insert in the datagrid increment the progress bar value by one...
And use Application.Doevents to see the progressbar moving...

Since loading time cant be calculated show marquee style progress bar and set cursor to busy. If loading makes your form unresponsive when clicked, do it in background thread.

Ajax has inbuilt Progress bar. I am not having visual studio right now else I would have told u exact name, but in the toll box, there are 5-6 controls like script manager, update panel etc. This progress bar one is also one of them. U just need to add this to page and provide image path in its tag which u want to show while the page is loading and the associated upadate panel. Thats it. It handles itself everything else

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.