Visual C# - How to Refresh datagrid, and other items when datagrid is populating.
Posted on 2008-11-03
Ok, I have a datagrid that I populate with network information. But while the data is being gathered for the datagrid, the form seems hung, which of course it is not, it just isn't repainting. Then when the datagrid has everything it needs, bam! everything shows up, and looks great.
This includes a animation of sorts that I've created to show that the program is actually still working (processsing) which does nothing more then cycle through 8 images to show motion....
But when the datagrid is gathering info, nothing refreshes at all.
I have tried starting a "timer" prior to the datagrid call, where in the timer, it has a refresh of the specifc picturebox's that I want to refresh, (ie. picMyPic1.refresh();) but that didn't work to refresh the "animation" while the datagrid was working on gathering the info.
I also tried just doing a refresh(); on a timer, to just refresh the whole form, again, no dice.
I've also tried putting refresh events into the animation itself (which is on a timer that cycles through the 8 images), but again, no dice...
So, the Q is... how do I activly refresh the screen so that it doesn't look like my app is hung while my datagrid is searching and building it's data.