using a wait cursor while datagridview refreshes

P

Peted

Hi
Using vs2008 C# winforms


So i have a datagridview bound to a dataset being populated via a
sqldataadaptor.

I have implemented a wait cursor, but it always reverts back to
default to soon.

It seems the data is loaded, within a try catch clause, which is where
i have my wait cursor code, but large amount of data takes a little
bit as it refreshs onto the screen.

I need the wait cursor to stay a wait cursor until the datagridview
onscreen refresh has finished.

Can anyone help with this


thanks
 
A

Armin Zingler

Peted said:
Hi
Using vs2008 C# winforms


So i have a datagridview bound to a dataset being populated via a
sqldataadaptor.

I have implemented a wait cursor, but it always reverts back to
default to soon.

It seems the data is loaded, within a try catch clause, which is where
i have my wait cursor code, but large amount of data takes a little
bit as it refreshs onto the screen.

Since WinXP, you can not be sure to get a screen output
during this process because of a ghost window. See 2nd paragraph here:
http://msdn.microsoft.com/en-us/library/ms644927(VS.85).aspx
However, that does not explain the cursor problem.
I need the wait cursor to stay a wait cursor until the datagridview
onscreen refresh has finished.

Can anyone help with this


Are you using Application.Doevents?
In addition, I suggest setting Cursor.Current, not YourControl.Cursor.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top