关于 DevExpress 控件问题

Ki_Sir 2011-07-22 03:46:32

有一个按钮"查询"

一个 gridcontrol 显示数据

焦点到 "查询" 上

按 回车 不送开

出了异常



--- A
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 DevExpress.Data.VisibleListSourceRowCollection.get_Count()
at DevExpress.Data.DataController.get_VisibleListSourceRowCount()
at DevExpress.Data.DataController.IsControllerRowValid(Int32 controllerRow)
at DevExpress.Data.CurrencyDataController.IsControllerRowValid(Int32 controllerRow)
at DevExpress.Data.DataController.IsControllerCellValid(Int32 controllerRow, Int32 column)
at DevExpress.Data.DataController.GetRowValue(Int32 controllerRow, Int32 column, OperationCompleted[] completed)
at DevExpress.Data.BaseListSourceDataController.GetRowValue(Int32 controllerRow, Int32 column, OperationCompleted[] completed)
at DevExpress.XtraGrid.Views.Base.ColumnView.GetRowCellValue(Int32 rowHandle, GridColumn column)
at DevExpress.XtraGrid.Views.Grid.GridView.GetRowCellValue(Int32 rowHandle, GridColumn column)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcRowCellDrawInfo(GridDataRowInfo ri, GridColumnInfoArgs ci, GridCellInfo cell,

GridColumnInfoArgs nextColumn, Boolean calcEditInfo)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcRowCellsDrawInfo(GridDataRowInfo ri, GridColumnsInfo columnsInfo)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcDataRow(GridDataRowInfo ri, GridRow row, GridRow nextRow)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcRowsDrawInfo()
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcGridInfo()
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.Calc(Graphics g, Rectangle bounds)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.FullRecalcScroll(Graphics g, Rectangle bounds)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcAfterVertScrollCore(Graphics g, Rectangle bounds, Boolean useCache)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcAfterVertScroll(Graphics g, Rectangle bounds, Boolean useCache)
at DevExpress.XtraGrid.Views.Grid.GridView.RefreshRows(Boolean useCache, Boolean afterScroll)
at DevExpress.XtraGrid.Views.Grid.GridView.CalculateDataCore()
at DevExpress.XtraGrid.Views.Grid.GridView.CalculateData()
at DevExpress.XtraGrid.Views.Base.BaseView.CheckViewInfo()
at DevExpress.XtraGrid.Views.Base.BaseView.Draw(GraphicsCache e)
at DevExpress.XtraGrid.GridControl.OnPaint(PaintEventArgs e)
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 DevExpress.XtraEditors.Container.EditorContainer.WndProc(Message& m)
at DevExpress.XtraGrid.GridControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3623 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------


-- B
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 DevExpress.Skins.SkinElementPainter.DrawImageStretch(SkinElementInfo info, Image image, Rectangle imageBounds, Rectangle screenBounds)
at DevExpress.Skins.SkinElementPainter.DrawImage(SkinElementInfo info, Image image, Rectangle imageBounds, Rectangle screenBounds, SkinImageStretch

stretch)
at DevExpress.Skins.SkinElementPainter.DrawImageStretchTile(SkinElementInfo info, SkinPaddingEdges paddingEdgesData, Image image, Rectangle

imageBounds, Rectangle destBounds, SkinImageStretch stretch)
at DevExpress.Skins.SkinElementPainter.DrawSkinImage(SkinElementInfo elementInfo, SkinImage skinImage)
at DevExpress.Skins.SkinElementPainter.DrawObject(ObjectInfoArgs e)
at DevExpress.Utils.Drawing.ObjectPainter.DrawObject(GraphicsCache cache, ObjectPainter painter, ObjectInfoArgs e)
at DevExpress.Utils.Drawing.RotateObjectPaintHelper.DrawRotated(GraphicsCache cache, ObjectInfoArgs info, ObjectPainter painter, RotateFlipType

rotate, Boolean alwaysCreate)
at DevExpress.Utils.Drawing.RotateObjectPaintHelper.DrawRotated(GraphicsCache cache, ObjectInfoArgs info, ObjectPainter painter, RotateFlipType

rotate)
at DevExpress.XtraEditors.Drawing.EditorButtonPainter.DrawButton(ObjectInfoArgs e)
at DevExpress.XtraEditors.Drawing.EditorButtonPainter.DrawObject(ObjectInfoArgs e)
at DevExpress.XtraEditors.Drawing.SkinEditorButtonPainter.DrawObject(ObjectInfoArgs e)
at DevExpress.XtraEditors.Drawing.ButtonEditPainter.DrawButton(ButtonEditViewInfo viewInfo, EditorButtonObjectInfoArgs info)
at DevExpress.XtraEditors.Drawing.ButtonEditPainter.DrawButtons(ControlGraphicsInfoArgs info, EditorButtonObjectCollection collection, Boolean

drawNormalDisabled)
at DevExpress.XtraEditors.Drawing.ButtonEditPainter.DrawButtons(ControlGraphicsInfoArgs info)
at DevExpress.XtraEditors.Drawing.ButtonEditPainter.DrawContent(ControlGraphicsInfoArgs info)
at DevExpress.XtraEditors.Drawing.BaseControlPainter.Draw(ControlGraphicsInfoArgs info)
at DevExpress.XtraEditors.Drawing.BaseEditPainter.Draw(ControlGraphicsInfoArgs info)
at DevExpress.XtraEditors.BaseControl.OnPaint(PaintEventArgs e)
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 DevExpress.Utils.Controls.ControlBase.WndProc(Message& m)
at DevExpress.XtraEditors.TextEdit.WndProc(Message& msg)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3623 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------


-- B
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 DevExpress.Data.GroupRowInfoCollection.GetGroupRowInfoByControllerRowHandle(Int32 controllerRowHandle)
at DevExpress.Data.DataController.IsRowExpanded(Int32 groupRowHandle)
at DevExpress.XtraGrid.Views.Grid.GridView.GetRowExpanded(Int32 rowHandle)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.GetRowFooterCount(Int32 rowHandle, Int32 rowVisibleIndex)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.GetTotalFooterRowHeight(Int32 rowHandle, Int32 rowVisibleIndex)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcTotalRowHeight(Graphics g, Int32 rowHandle, Int32 rowVisibleIndex, Int32 level)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.LoadRowsCore(GridRowsLoadInfo e)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.LoadRows(GridRowsLoadInfo e)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcAfterVertScrollCore(Graphics g, Rectangle bounds, Boolean useCache)
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcAfterVertScroll(Graphics g, Rectangle bounds, Boolean useCache)
at DevExpress.XtraGrid.Views.Grid.GridView.RefreshRows(Boolean useCache, Boolean afterScroll)
at DevExpress.XtraGrid.Views.Grid.GridView.CalculateDataCore()
at DevExpress.XtraGrid.Views.Grid.GridView.CalculateData()
at DevExpress.XtraGrid.Views.Base.BaseView.CheckViewInfo()
at DevExpress.XtraGrid.Views.Base.BaseView.Draw(GraphicsCache e)
at DevExpress.XtraGrid.GridControl.OnPaint(PaintEventArgs e)
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 DevExpress.XtraEditors.Container.EditorContainer.WndProc(Message& m)
at DevExpress.XtraGrid.GridControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3623 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------



请教高手解释下
...全文
306 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
wanghafan 2011-08-02
  • 打赏
  • 举报
回复
和回车没啥关系吧
DSIOF3KIDSKTR 2011-08-01
  • 打赏
  • 举报
回复
报错信息的标题写的很清楚:NullReferenceException(未将对象设置到引用),跟你按住回车不松手有关系吗?
jeje 2011-07-27
  • 打赏
  • 举报
回复
你的按钮控件执行的什么代码啊.只是将数据查询出来然后绑定到gridControl的datasource上的吗
Ki_Sir 2011-07-27
  • 打赏
  • 举报
回复
按钮控件(第三方控件) 会变成红X gridview 也会红X
叫我三三 2011-07-26
  • 打赏
  • 举报
回复
异常说的很清楚了
NullReferenceException
未将对象应用到实例错误
你代码的问题 和控件沒关系吧
aierda 2011-07-26
  • 打赏
  • 举报
回复
是对象引用未被实例化,你好好检查下代码,或者用断点调试下
itliyi 2011-07-26
  • 打赏
  • 举报
回复
有没有破解,之前一直用,没出现过楼主所说的问题
ycproc 2011-07-25
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 sugarbelle 的回复:]

DevExpress 是系统自带的吗
[/Quote]
第三方的商业控件


用别人的 不知道 出问题的原因很正常

你去 democenter去看官方怎么用的
sesshoumaru99 2011-07-23
  • 打赏
  • 举报
回复
你写了些什么事件呢?
sugarbelle 2011-07-22
  • 打赏
  • 举报
回复
DevExpress 是系统自带的吗

110,566

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧