using a wait cursor while datagridview refreshes

  • Thread starter Thread starter Peted
  • Start date Start date
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
 
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.
 
Back
Top