Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

using a wait cursor while datagridview refreshes

5 views
Skip to first unread message

Peted

unread,
Dec 30, 2009, 4:43:36 AM12/30/09
to
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

Armin Zingler

unread,
Dec 30, 2009, 7:06:10 AM12/30/09
to
Peted schrieb:

> 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.


--
Armin

0 new messages