Dev中gridview里单元格合并但是拖动横向滚动条时异常

时间:2022-03-07 14:46:40
Message: System.NullReferenceException: 未将对象引用设置到对象的实例。
   在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridMergedCellInfo.AddMergedCell(GridCellInfo cell)
   在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfoCellMerger.Calc(Int32 column)
   在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfoCellMerger.Calc()
   在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcRowsMergeInfo()
   在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcRowsDrawInfo()
   在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.CalcGridInfo()
   在 DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.Calc(Graphics g, Rectangle bounds)
   在 DevExpress.XtraGrid.Views.Grid.GridView.DoInternalLayout()
   在 DevExpress.XtraGrid.Views.Grid.GridView.CalculateLayout()
   在 DevExpress.XtraGrid.Views.Grid.GridView.LayoutChanged()
   在 DevExpress.XtraGrid.Views.Base.BaseView.LayoutChangedSynchronized()
   在 DevExpress.XtraGrid.Views.Grid.GridView.SetViewRect(Rectangle newValue)
   在 DevExpress.XtraGrid.Views.Base.BaseView.InternalSetViewRectCore(Rectangle rect)
   在 DevExpress.XtraGrid.Views.Grid.Handler.GridHandler.OnResize(Rectangle clientRect)
   在 DevExpress.Utils.Controls.BaseHandler.ProcessEvent(EventType etype, Object args)
   在 DevExpress.XtraGrid.Views.Base.Handler.BaseViewHandler.ProcessEvent(EventType etype, Object args)
   在 DevExpress.XtraGrid.GridControl.OnResize(EventArgs e)
   在 System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
   在 System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
   在 System.Windows.Forms.Control.UpdateBounds()
   在 System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
   在 System.Windows.Forms.Control.WndProc(Message& m)
   在 DevExpress.XtraEditors.Container.EditorContainer.WndProc(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

2 个解决方案

#1


先会调试,看看哪行代码错误。
http://www.cnblogs.com/alexis/archive/2010/11/06/1870519.html

#2


拖动滚动条时会重新绘制GridView,你看看是不是绘制的时候出的问题。

#1


先会调试,看看哪行代码错误。
http://www.cnblogs.com/alexis/archive/2010/11/06/1870519.html

#2


拖动滚动条时会重新绘制GridView,你看看是不是绘制的时候出的问题。