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

How to fix Big Red Cross on the screen

884 views
Skip to first unread message

david

unread,
Feb 16, 2004, 3:55:10 PM2/16/04
to
Hi All,
I have a .NET application written by C#.
It works fine in the most time, but sometimes, once or twice a day, there
are red cross on the screen.
The position of red cross is the position of visible object, like button,
datagrid.
But the application still works, and when it comes back the same screen next
time, there is no red cross any more, every thing show normally.
It has haunted me for a long time. I don't know how to fix it.
It seems a memory leakage problem, but I didn't find any clues about it.

I greatly appreciate any help.


David


Justin Rogers

unread,
Feb 16, 2004, 6:32:03 PM2/16/04
to
Red cross generally means the paint for that object has failed. This might be
because you are
throwing an exception in the paint routine.


--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"david" <david...@lycos.com> wrote in message
news:uJXur8M9...@TK2MSFTNGP11.phx.gbl...

david

unread,
Feb 17, 2004, 11:02:52 AM2/17/04
to
Hi Justin,
But they are .NET objects and I didn't rewrite paint event.

David


"Justin Rogers" <Jus...@games4dotnet.com> wrote in message
news:OmwzbUO9...@TK2MSFTNGP11.phx.gbl...

david

unread,
Feb 17, 2004, 1:31:13 PM2/17/04
to
I got the error log as below.


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an
object.
at System.Data.DataView.IsOriginalVersion(Int32 index)
at System.Data.DataRowView.GetColumnValue(DataColumn column)
at System.Data.DataColumnPropertyDescriptor.GetValue(Object component)
at
System.Windows.Forms.DataGridColumnStyle.GetColumnValueAtRow(CurrencyManager
source, Int32 rowNum)
at System.Windows.Forms.DataGridTextBoxColumn.Paint(Graphics g, Rectangle
bounds, CurrencyManager source, Int32 rowNum, Brush backBrush, Brush
foreBrush, Boolean alignToRight)
at
System.Windows.Forms.DataGridRelationshipRow.PaintCellContents(Graphics g,
Rectangle cellBounds, DataGridColumnStyle column, Brush backBr, Brush
foreBrush, Boolean alignToRight)
at System.Windows.Forms.DataGridRow.PaintData(Graphics g, Rectangle
bounds, Int32 firstVisibleColumn, Int32 columnCount, Boolean alignToRight)
at System.Windows.Forms.DataGridRelationshipRow.Paint(Graphics g,
Rectangle bounds, Rectangle trueRowBounds, Int32 firstVisibleColumn, Int32
numVisibleColumns, Boolean alignToRight)
at System.Windows.Forms.DataGrid.PaintRows(Graphics g, Rectangle&
boundingRect)
at System.Windows.Forms.DataGrid.PaintGrid(Graphics g, Rectangle
gridBounds)
at System.Windows.Forms.DataGrid.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------


Alex Brunner, ALL CONSULTING AG, Switzerland

unread,
Feb 20, 2004, 3:28:11 AM2/20/04
to
Hi David

Did you ever try to attach the VS2003 Debugger to the running application
and enable the debugging of all exceptions to break into the debugger?

This normally helps to solve the problem in a very efficient way.

Regards,
Alex

"david" <david...@lycos.com> wrote in message

news:OE3kA#W9DHA...@tk2msftngp13.phx.gbl...

Scott F.

unread,
Mar 9, 2004, 1:01:11 PM3/9/04
to
I, too have this problem and receive the exact same Exception stack trace as David. I do not have an override Paint method, nor is there anything special aboutthe datagrid itself.

I have a datagrid bound to a multitable dataset - Source is the dataset, Member is the data table. In my particluar case, I am experiencing the "red x" error after handling a DBConcurrencyException. It happens after I do the following step:
-- Load a dataset with data from the database
-- Modify a field in a row using the application
-- Modify a field in the same row at the server
-- Pass the dataset to the dataadapter for an Update
-- Receive a DBConcurrencyException
-- Manipulate the DBConcurrencyException object (dbcx.Row)
to change the values to what I want stored to the database
-- Merge the dbcx.Row back into the dataset
-- Update the dataset to the database using a DataAdapter
-- Come back after the method call and resume
processing control to the form
--...and BLAM. NullReferenceException with the red x.
Again, I get the same Exception Trace as David.

Everything works great withthe database access; it stores the desired values into the database tables. In fact, I don't get an error until the form tries to repaint the datagrid. If I close the form immediately after calling the database update, I don't get the error. I am suspecting that there is some kind of "row version problem" on the particular row that I am editing, but I am having a tough time figuring it out.

Anyone else?
---Scott F.

david

unread,
Mar 17, 2004, 3:44:07 PM3/17/04
to
I got a workaround solution.
After update the dataset, use acceptchange.
It fixed most of the red x, but still got some red x left occationally, very
rare.

David

"Scott F." <anon...@discussions.microsoft.com> wrote in message
news:5C98756F-7CF2-4D53...@microsoft.com...

DotNetJunkies User

unread,
Aug 2, 2004, 2:01:39 PM8/2/04
to

I have the same problem. Has anyone got any idea ?


---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.

Lloyd Dupont

unread,
Aug 3, 2004, 12:21:27 AM8/3/04
to
use a debuger !

"DotNetJunkies User" <User@-NOSPAM-DotNetJunkies.com> wrote in message
news:epAhDrLe...@TK2MSFTNGP10.phx.gbl...

Lloyd Dupont

unread,
Aug 3, 2004, 12:21:16 AM8/3/04
to
I haven't seen the question.
but I guess in a Control it's an exception while OnPaint() was called.

"DotNetJunkies User" <User@-NOSPAM-DotNetJunkies.com> wrote in message
news:epAhDrLe...@TK2MSFTNGP10.phx.gbl...
>

Laasma

unread,
Apr 25, 2005, 7:21:46 AM4/25/05
to
I had the same problem, and I found one solution. It is not the best, but it works. After updating dataset I wrote:
Me.ugKred.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ActivateCell)


From http://www.developmentnow.com/g/23_2004_2_0_0_108009/How-to-fix-Big-Red-Cross-on-the-screen.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com

0 new messages