DataGridView Red“X” [英] DataGridView Red "X"

查看:51
本文介绍了DataGridView Red“X”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hey
all,

我想知道是否有人在.NET 2.0中看到过他们的DataGridView控件上的
恼人的红十字会;如果你
有关于它的原因或如何解决它们的指示?到目前为止,只有
出现在Q& A团队的系统上,他们正在测试系统;但我b $ b无法在我的机器(或任何我们的开发人员)上复制此内容。
唯一能够尝试隔离并批准它的解决方案是将
的数据源设置为空,然后在刷新时重新绑定它...这仍然是奇怪的是
这种情况​​发生了虽然我似乎无法在网上找到太多帮助或谷歌
(在任何人说JFGI之前
J

I was wondering if anyone has seen an annoying Red Cross on their DataGridView controls yet in .NET 2.0; and if you have any pointers on what causes it or how to resolve them? So far it only occurs on the Q&A team’s systems that they are testing the system on; yet I can’t replicate this on my machine (or any of us developers for that matter). The only resolution I’ve been able to try and isolate and ratify it, is to set the data source to nothing and then rebind it on refresh… It is still odd that this happens though and I can’t seem to find much help on the net or google (before anyone says JFGI J)

我知道这是因为对象没有设置为任何东西 - 但是:

I know it is because the object is not set to anything - but:

  • < font face = Arial size = 2> 表格仍然可见
  • 这是VS 2005中现成的MS控件
  • <字体face = Arial size = 2> 我没有处理或关闭控件/表格

System.NullReferenceException:
对象引用未设置为一个对象的实例。
at
System.Windows.Forms.DataGridViewRowHeaderCell.PaintPrivate(图形图形,
矩形clipBounds,Rectangle cellBounds,Int32 rowIndex,
DataGridViewElementStates dataGridViewElementState,Object formattedValue,
String errorText,DataGridViewCellStyle cellStyle,
DataGridViewAdvancedBorderStyle advancedBorderStyle,DataGridViewPaintParts
paintParts,Boolean computeContentBounds,B oolean computeErrorIconBounds,
Boolean paint)
at
System.Windows.Forms.DataGridViewRowHeaderCell.Paint(Graphics graphics,
Rectangle clipBounds,Rectangle cellBounds,Int32 rowIndex,
DataGridViewElementStates cellState ,Object value,Object formattedValue,String
errorText,DataGridViewCellStyle cellStyle,DataGridViewAdvancedBorderStyle
advancedBorderStyle,DataGridViewPaintParts paintParts)
at
System.Windows.Forms.DataGridViewCell.PaintWork(Graphics graphics,Rectangle
clipBounds,Rectangle cellBounds,Int32 rowIndex,DataGridViewElementStates
cellState,DataGridViewCellStyle cellStyle,DataGridViewAdvancedBorderStyle
advancedBorderStyle,DataGridViewPaintParts paintParts)
at
System.Windows.Forms.DataGridViewRow.PaintHeader(Graphics graphics,Rectangle
clipBounds,Rectangle rowBounds,Int32 rowIndex,DataGridViewElementStates
rowState,Boolean isFirstDisplayedRow,Boolean isLastVisible行,
DataGridViewPaintParts paintParts)
at
System.Windows.Forms.DataGridViewRow.Paint(Graphics graphics,Rectangle
clipBounds,Rectangle rowBounds,Int32 rowIndex,DataGridViewElementStates
rowState, Boolean isFirstDisplayedRow,Boolean isLastVisibleRow)
$ $ $ $ $ System $ Windows $。 Windows.Forms.DataGridView.PaintGrid(Graphics g,Rectangle gridBounds,
Rectangle clipRect,Boolean singleVerticalBorderAdded,Boolean
singleHorizo​​ntalBorderAdded)
at
System.Windows.Forms.DataGridView.OnPaint(PaintEventArgs e)

System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,Int16
layer,Boolean disposeEventArgs)
at
System.Windows.Forms.Control.WmPaint (消息&安培; m)

System.Windows.Forms.Control.WndProc(Message& m)
at
System.Windows.Forms.DataGridView.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
在System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd,Int32 msg,
IntPtr wparam,IntPtr lparam)

推荐答案

当然,我已经看过很多次了。对我来说,这主要发生在我从IDE运行我的应用程序时,正在运行的屏幕保护程序以及大多数时间(但并非总是)。然而,我还没有深入研究,因为当它发生时,调用堆栈总是来自外部代码,而不是来自我开发的代码。调用堆栈似乎总是与绘图或绘画有关,我不会覆盖我的应用程序中的任何方法。所以我希望这是一个超出我所写范围的问题。我意识到这可能是一个错误的希望,但还有其他优先事项。

Sure, of course I've seen that - many times.  For me, this mostly happens when I am coming out of a screen saver that is running and most times (but not always) when I am running my app from the IDE.  I have not yet looked into in any depth however, because when it happens the call stack is always from external code, never from within the code I developed.  The call stack always seems to have something to do with drawing or painting as well and I don't override any of those methods in my app.  So I am hoping that it is a problem outside the scope of what I have written.  I realize that this may be a false hope, but there are other priorities.


这篇关于DataGridView Red“X”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆