Hello everyone,

I am having a recurrent problem that I'm unable to find a solution to.

Everyday, someone in the office using the application developed would
get an error. After going through the error-trapping message, the
DataGrid on the form would turn into a big red X with white
background. If the user closes the form, and reopen it, the big red X
will go away, and the error won't happen again. Even if they repeat
exactly what they were doing 10 more times, the error just wouldn't
happen.

It's frustrating because I'm unable to duplicate the error at will.
Some computers seem to get the problem once or twice per day while
others have never seen this error.

Some pertinent information ~

Every single grid has a TableStyle using derived
DataGridTextBoxColumn. The DataGridTextBoxColumn overrides Paint()
and paints each cell as specified. The code for the override is
originally from

http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q927q

but we modified it to modify the textbox content before drawing it on
the DataGrid.

The changes we made can be found on
http://www.rodtv.com/Class_DataGridFormattableTextBoxColumn.txt

There's another thread on the NGs that I found via Google Groups that
seems similiar. The paint override does use CurrencyManager, and
according to Daniel Herling [MS], it's a known issue. But the post
was long ago, so I'm wondering if the issue had been fixed already.

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=O7W79dr%24BHA.1836%40tkmsftngp05

If anyone can help, I'd really appreciate it! Thanks for any help in
advance!

Re: Red Cross / Red X on DataGrids with Paint Override & BindingManagerBase by JerryK

JerryK
Tue Sep 23 13:58:02 CDT 2003

Chung,

Does this occur when you make changes to the contents of the grid or it's
underlying dataset. If so, I have noticed that there is a problem with
handling grid re-paints. My experience with the Infragistics grid, which is
different, is that suspending painting while updating data seems to make the
app more stable.

Jerry

"Chung Tsen" <chungtsen@cfl.rr.com> wrote in message
news:da568c47.0309230856.25a930b8@posting.google.com...
> Hello everyone,
>
> I am having a recurrent problem that I'm unable to find a solution to.
>
> Everyday, someone in the office using the application developed would
> get an error. After going through the error-trapping message, the
> DataGrid on the form would turn into a big red X with white
> background. If the user closes the form, and reopen it, the big red X
> will go away, and the error won't happen again. Even if they repeat
> exactly what they were doing 10 more times, the error just wouldn't
> happen.
>
> It's frustrating because I'm unable to duplicate the error at will.
> Some computers seem to get the problem once or twice per day while
> others have never seen this error.
>
> Some pertinent information ~
>
> Every single grid has a TableStyle using derived
> DataGridTextBoxColumn. The DataGridTextBoxColumn overrides Paint()
> and paints each cell as specified. The code for the override is
> originally from
>
> http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q927q
>
> but we modified it to modify the textbox content before drawing it on
> the DataGrid.
>
> The changes we made can be found on
> http://www.rodtv.com/Class_DataGridFormattableTextBoxColumn.txt
>
> There's another thread on the NGs that I found via Google Groups that
> seems similiar. The paint override does use CurrencyManager, and
> according to Daniel Herling [MS], it's a known issue. But the post
> was long ago, so I'm wondering if the issue had been fixed already.
>
>
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=O7W79dr%24BHA.1836%40tkmsftngp05
>
> If anyone can help, I'd really appreciate it! Thanks for any help in
> advance!



Re: Red Cross / Red X on DataGrids with Paint Override & BindingManagerBase by chungtsen

chungtsen
Tue Sep 23 16:33:05 CDT 2003

Thanks for your reply Jerry,

I've tried making the datagrid invisible then turning it visible at
the very last line -- right before the control is returned to the
user. But that seemed like such a silly solution that I abandoned it.
Is there a better way to suspend painting event?

Chung


"JerryK" <jerryk@insteptech.com> wrote in message news:<esZ0gSggDHA.1088@TK2MSFTNGP10.phx.gbl>...
> Chung,
>
> Does this occur when you make changes to the contents of the grid or it's
> underlying dataset. If so, I have noticed that there is a problem with
> handling grid re-paints. My experience with the Infragistics grid, which is
> different, is that suspending painting while updating data seems to make the
> app more stable.
>
> Jerry