Red Cross / Red X on DataGrids with Paint Override & BindingManagerBase

C

Chung Tsen

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$BHA.1836@tkmsftngp05

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

JerryK

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
 
C

Chung Tsen

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
 

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