jdressing
asked on
I get a similar error when resizing the window or tab the gird resides on - Index was out of range
I am using VB.Net 2008 (Version: 9.0.21022.8), running on Vista Buisiness. I was having this happen when the project was originally written in VB.Net 2005
This happens randomly when I resize the window or tab that the grid resides on. Why would an index error happen on my datagridview column when I resize the datagridview? I assume this is happening on my datagridview column that is a combo box. I have no resize logic on the datagridview... some kind of helper thread that happens automatically in the background is triggering this.
Here is the full errror:
System.ArgumentOutOfRangeE xception was unhandled
Message="Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"
Source="mscorlib"
ParamName="index"
StackTrace:
at System.Collections.ArrayLi st.get_Ite m(Int32 index)
at System.Windows.Forms.DataG ridViewCol umnCollect ion.get_It em(Int32 index)
at System.Windows.Forms.DataG ridView.Fl ushDisplay edChanged( )
at System.Windows.Forms.DataG ridView.Pe rformLayou tPrivate(B oolean useRowShortcut, Boolean computeVisibleRows, Boolean invalidInAdjustFillingColu mns, Boolean repositionEditingControl)
at System.Windows.Forms.DataG ridView.On Layout(Lay outEventAr gs e)
at System.Windows.Forms.Contr ol.Perform Layout(Lay outEventAr gs args)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Pe rformLayou t(IArrange dElement affectedElement, String affectedProperty)
at System.Windows.Forms.Layou t.LayoutTr ansaction. DoLayout(I ArrangedEl ement elementToLayout, IArrangedElement elementCausingLayout, String property)
at System.Windows.Forms.Contr ol.OnResiz e(EventArg s e)
at System.Windows.Forms.DataG ridView.On Resize(Eve ntArgs e)
at System.Windows.Forms.Contr ol.OnSizeC hanged(Eve ntArgs e)
at System.Windows.Forms.Contr ol.UpdateB ounds(Int3 2 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Contr ol.UpdateB ounds()
at System.Windows.Forms.Contr ol.WmWindo wPosChange d(Message& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.DataG ridView.Wn dProc(Mess age& m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeN ativeMetho ds.SetWind owPos(Hand leRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
at System.Windows.Forms.Contr ol.SetBoun dsCore(Int 32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.DataG ridView.Se tBoundsCor e(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Se tBounds(Re ctangle bounds, BoundsSpecified specified)
at System.Windows.Forms.Layou t.DefaultL ayout.Appl yCachedBou nds(IArran gedElement container)
at System.Windows.Forms.Layou t.DefaultL ayout.xLay out(IArran gedElement container, Boolean measureOnly, Size& preferredSize)
at System.Windows.Forms.Layou t.DefaultL ayout.Layo utCore(IAr rangedElem ent container, LayoutEventArgs args)
at System.Windows.Forms.Layou t.LayoutEn gine.Layou t(Object container, LayoutEventArgs layoutEventArgs)
at System.Windows.Forms.Contr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Scrol lableContr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Contr ol.Perform Layout(Lay outEventAr gs args)
at System.Windows.Forms.Contr ol.Perform Layout()
at System.Windows.Forms.Contr ol.ResumeL ayout(Bool ean performLayout)
at System.Windows.Forms.Contr ol.ResumeL ayout()
at System.Windows.Forms.Split Container. ResizeSpli tContainer ()
at System.Windows.Forms.Split Container. OnLayout(L ayoutEvent Args e)
at System.Windows.Forms.Contr ol.Perform Layout(Lay outEventAr gs args)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Pe rformLayou t(IArrange dElement affectedElement, String affectedProperty)
at System.Windows.Forms.Layou t.LayoutTr ansaction. DoLayout(I ArrangedEl ement elementToLayout, IArrangedElement elementCausingLayout, String property)
at System.Windows.Forms.Contr ol.OnResiz e(EventArg s e)
at System.Windows.Forms.Contr ol.OnSizeC hanged(Eve ntArgs e)
at System.Windows.Forms.Contr ol.UpdateB ounds(Int3 2 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Contr ol.UpdateB ounds()
at System.Windows.Forms.Contr ol.WmWindo wPosChange d(Message& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Scrol lableContr ol.WndProc (Message& m)
at System.Windows.Forms.Conta inerContro l.WndProc( Message& m)
at System.Windows.Forms.Split Container. WndProc(Me ssage& msg)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeN ativeMetho ds.SetWind owPos(Hand leRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
at System.Windows.Forms.Contr ol.SetBoun dsCore(Int 32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Split Container. SetBoundsC ore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Se tBounds(Re ctangle bounds, BoundsSpecified specified)
at System.Windows.Forms.Layou t.DefaultL ayout.Appl yCachedBou nds(IArran gedElement container)
at System.Windows.Forms.Layou t.DefaultL ayout.xLay out(IArran gedElement container, Boolean measureOnly, Size& preferredSize)
at System.Windows.Forms.Layou t.DefaultL ayout.Layo utCore(IAr rangedElem ent container, LayoutEventArgs args)
at System.Windows.Forms.Layou t.LayoutEn gine.Layou t(Object container, LayoutEventArgs layoutEventArgs)
at System.Windows.Forms.Contr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Scrol lableContr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Contr ol.Perform Layout(Lay outEventAr gs args)
at System.Windows.Forms.Contr ol.Perform Layout()
at System.Windows.Forms.Contr ol.ResumeL ayout(Bool ean performLayout)
at System.Windows.Forms.Contr ol.ResumeL ayout()
at System.Windows.Forms.Split Container. ResizeSpli tContainer ()
at System.Windows.Forms.Split Container. OnLayout(L ayoutEvent Args e)
at System.Windows.Forms.Contr ol.Perform Layout(Lay outEventAr gs args)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Pe rformLayou t(IArrange dElement affectedElement, String affectedProperty)
at System.Windows.Forms.Layou t.LayoutTr ansaction. DoLayout(I ArrangedEl ement elementToLayout, IArrangedElement elementCausingLayout, String property)
at System.Windows.Forms.Contr ol.OnResiz e(EventArg s e)
at System.Windows.Forms.Contr ol.OnSizeC hanged(Eve ntArgs e)
at System.Windows.Forms.Contr ol.UpdateB ounds(Int3 2 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Contr ol.UpdateB ounds()
at System.Windows.Forms.Contr ol.WmWindo wPosChange d(Message& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Scrol lableContr ol.WndProc (Message& m)
at System.Windows.Forms.Conta inerContro l.WndProc( Message& m)
at System.Windows.Forms.Split Container. WndProc(Me ssage& msg)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeN ativeMetho ds.SetWind owPos(Hand leRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
at System.Windows.Forms.Contr ol.SetBoun dsCore(Int 32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Split Container. SetBoundsC ore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Se tBounds(Re ctangle bounds, BoundsSpecified specified)
at System.Windows.Forms.Layou t.DefaultL ayout.Appl yCachedBou nds(IArran gedElement container)
at System.Windows.Forms.Layou t.DefaultL ayout.xLay out(IArran gedElement container, Boolean measureOnly, Size& preferredSize)
at System.Windows.Forms.Layou t.DefaultL ayout.Layo utCore(IAr rangedElem ent container, LayoutEventArgs args)
at System.Windows.Forms.Layou t.LayoutEn gine.Layou t(Object container, LayoutEventArgs layoutEventArgs)
at System.Windows.Forms.Contr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Scrol lableContr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Contr ol.Perform Layout(Lay outEventAr gs args)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Pe rformLayou t(IArrange dElement affectedElement, String affectedProperty)
at System.Windows.Forms.Layou t.LayoutTr ansaction. DoLayout(I ArrangedEl ement elementToLayout, IArrangedElement elementCausingLayout, String property)
at System.Windows.Forms.Contr ol.OnResiz e(EventArg s e)
at System.Windows.Forms.Panel .OnResize( EventArgs eventargs)
at System.Windows.Forms.Contr ol.OnSizeC hanged(Eve ntArgs e)
at System.Windows.Forms.Contr ol.UpdateB ounds(Int3 2 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Contr ol.UpdateB ounds()
at System.Windows.Forms.Contr ol.WmWindo wPosChange d(Message& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Scrol lableContr ol.WndProc (Message& m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeN ativeMetho ds.SetWind owPos(Hand leRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
at System.Windows.Forms.Contr ol.SetBoun dsCore(Int 32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.TabPa ge.SetBoun dsCore(Int 32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Contr ol.SetBoun ds(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Contr ol.set_Bou nds(Rectan gle value)
at System.Windows.Forms.TabCo ntrol.Upda teTabSelec tion(Boole an updateFocus)
at System.Windows.Forms.TabCo ntrol.OnRe size(Event Args e)
at System.Windows.Forms.Contr ol.OnSizeC hanged(Eve ntArgs e)
at System.Windows.Forms.Contr ol.UpdateB ounds(Int3 2 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Contr ol.UpdateB ounds()
at System.Windows.Forms.Contr ol.WmWindo wPosChange d(Message& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.TabCo ntrol.WndP roc(Messag e& m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeN ativeMetho ds.SetWind owPos(Hand leRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
at System.Windows.Forms.Contr ol.SetBoun dsCore(Int 32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Se tBounds(Re ctangle bounds, BoundsSpecified specified)
at System.Windows.Forms.Layou t.DefaultL ayout.Appl yCachedBou nds(IArran gedElement container)
at System.Windows.Forms.Layou t.DefaultL ayout.xLay out(IArran gedElement container, Boolean measureOnly, Size& preferredSize)
at System.Windows.Forms.Layou t.DefaultL ayout.Layo utCore(IAr rangedElem ent container, LayoutEventArgs args)
at System.Windows.Forms.Layou t.LayoutEn gine.Layou t(Object container, LayoutEventArgs layoutEventArgs)
at System.Windows.Forms.Contr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Scrol lableContr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Contr ol.Perform Layout(Lay outEventAr gs args)
at System.Windows.Forms.Contr ol.Perform Layout()
at System.Windows.Forms.Contr ol.ResumeL ayout(Bool ean performLayout)
at System.Windows.Forms.Contr ol.ResumeL ayout()
at System.Windows.Forms.Split Container. ResizeSpli tContainer ()
at System.Windows.Forms.Split Container. OnLayout(L ayoutEvent Args e)
at System.Windows.Forms.Contr ol.Perform Layout(Lay outEventAr gs args)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Pe rformLayou t(IArrange dElement affectedElement, String affectedProperty)
at System.Windows.Forms.Layou t.LayoutTr ansaction. DoLayout(I ArrangedEl ement elementToLayout, IArrangedElement elementCausingLayout, String property)
at System.Windows.Forms.Contr ol.OnResiz e(EventArg s e)
at System.Windows.Forms.Contr ol.OnSizeC hanged(Eve ntArgs e)
at System.Windows.Forms.Contr ol.UpdateB ounds(Int3 2 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Contr ol.UpdateB ounds()
at System.Windows.Forms.Contr ol.WmWindo wPosChange d(Message& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Scrol lableContr ol.WndProc (Message& m)
at System.Windows.Forms.Conta inerContro l.WndProc( Message& m)
at System.Windows.Forms.Split Container. WndProc(Me ssage& msg)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeN ativeMetho ds.SetWind owPos(Hand leRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
at System.Windows.Forms.Contr ol.SetBoun dsCore(Int 32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Split Container. SetBoundsC ore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Se tBounds(Re ctangle bounds, BoundsSpecified specified)
at System.Windows.Forms.Layou t.DefaultL ayout.Appl yCachedBou nds(IArran gedElement container)
at System.Windows.Forms.Layou t.DefaultL ayout.xLay out(IArran gedElement container, Boolean measureOnly, Size& preferredSize)
at System.Windows.Forms.Layou t.DefaultL ayout.Layo utCore(IAr rangedElem ent container, LayoutEventArgs args)
at System.Windows.Forms.Layou t.LayoutEn gine.Layou t(Object container, LayoutEventArgs layoutEventArgs)
at System.Windows.Forms.Contr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Scrol lableContr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Conta inerContro l.OnLayout (LayoutEve ntArgs e)
at System.Windows.Forms.Contr ol.Perform Layout(Lay outEventAr gs args)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Pe rformLayou t(IArrange dElement affectedElement, String affectedProperty)
at System.Windows.Forms.Layou t.LayoutTr ansaction. DoLayout(I ArrangedEl ement elementToLayout, IArrangedElement elementCausingLayout, String property)
at System.Windows.Forms.Contr ol.OnResiz e(EventArg s e)
at System.Windows.Forms.UserC ontrol.OnR esize(Even tArgs e)
at System.Windows.Forms.Contr ol.OnSizeC hanged(Eve ntArgs e)
at System.Windows.Forms.Contr ol.UpdateB ounds(Int3 2 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Contr ol.UpdateB ounds()
at System.Windows.Forms.Contr ol.WmWindo wPosChange d(Message& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Scrol lableContr ol.WndProc (Message& m)
at System.Windows.Forms.Conta inerContro l.WndProc( Message& m)
at System.Windows.Forms.UserC ontrol.Wnd Proc(Messa ge& m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeN ativeMetho ds.SetWind owPos(Hand leRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
at System.Windows.Forms.Contr ol.SetBoun dsCore(Int 32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Se tBounds(Re ctangle bounds, BoundsSpecified specified)
at System.Windows.Forms.Layou t.DefaultL ayout.Appl yCachedBou nds(IArran gedElement container)
at System.Windows.Forms.Layou t.DefaultL ayout.xLay out(IArran gedElement container, Boolean measureOnly, Size& preferredSize)
at System.Windows.Forms.Layou t.DefaultL ayout.Layo utCore(IAr rangedElem ent container, LayoutEventArgs args)
at System.Windows.Forms.Layou t.LayoutEn gine.Layou t(Object container, LayoutEventArgs layoutEventArgs)
at System.Windows.Forms.Contr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Scrol lableContr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Form. OnLayout(L ayoutEvent Args levent)
at System.Windows.Forms.Contr ol.Perform Layout(Lay outEventAr gs args)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Pe rformLayou t(IArrange dElement affectedElement, String affectedProperty)
at System.Windows.Forms.Layou t.LayoutTr ansaction. DoLayout(I ArrangedEl ement elementToLayout, IArrangedElement elementCausingLayout, String property)
at System.Windows.Forms.Contr ol.OnResiz e(EventArg s e)
at System.Windows.Forms.Form. OnResize(E ventArgs e)
at System.Windows.Forms.Contr ol.OnSizeC hanged(Eve ntArgs e)
at System.Windows.Forms.Contr ol.UpdateB ounds(Int3 2 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Contr ol.UpdateB ounds()
at System.Windows.Forms.Contr ol.WmWindo wPosChange d(Message& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Scrol lableContr ol.WndProc (Message& m)
at System.Windows.Forms.Conta inerContro l.WndProc( Message& m)
at System.Windows.Forms.Form. WndProc(Me ssage& m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Unsaf eNativeMet hods.CallW indowProc( IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Nativ eWindow.De fWndProc(M essage& m)
at System.Windows.Forms.Contr ol.DefWndP roc(Messag e& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.MdiCl ient.WndPr oc(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Unsaf eNativeMet hods.CallW indowProc( IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Nativ eWindow.De fWndProc(M essage& m)
at System.Windows.Forms.Contr ol.DefWndP roc(Messag e& m)
at System.Windows.Forms.Contr ol.WmWindo wPosChange d(Message& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.MdiCl ient.WndPr oc(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeN ativeMetho ds.SetWind owPos(Hand leRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
at System.Windows.Forms.Contr ol.SetBoun dsCore(Int 32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.MdiCl ient.SetBo undsCore(I nt32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Se tBounds(Re ctangle bounds, BoundsSpecified specified)
at System.Windows.Forms.Layou t.DefaultL ayout.Appl yCachedBou nds(IArran gedElement container)
at System.Windows.Forms.Layou t.DefaultL ayout.xLay out(IArran gedElement container, Boolean measureOnly, Size& preferredSize)
at System.Windows.Forms.Layou t.DefaultL ayout.Layo utCore(IAr rangedElem ent container, LayoutEventArgs args)
at System.Windows.Forms.Layou t.LayoutEn gine.Layou t(Object container, LayoutEventArgs layoutEventArgs)
at System.Windows.Forms.Contr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Scrol lableContr ol.OnLayou t(LayoutEv entArgs levent)
at System.Windows.Forms.Form. OnLayout(L ayoutEvent Args levent)
at System.Windows.Forms.Contr ol.Perform Layout(Lay outEventAr gs args)
at System.Windows.Forms.Contr ol.System. Windows.Fo rms.Layout .IArranged Element.Pe rformLayou t(IArrange dElement affectedElement, String affectedProperty)
at System.Windows.Forms.Layou t.LayoutTr ansaction. DoLayout(I ArrangedEl ement elementToLayout, IArrangedElement elementCausingLayout, String property)
at System.Windows.Forms.Contr ol.OnResiz e(EventArg s e)
at System.Windows.Forms.Form. OnResize(E ventArgs e)
at System.Windows.Forms.Contr ol.OnSizeC hanged(Eve ntArgs e)
at System.Windows.Forms.Contr ol.UpdateB ounds(Int3 2 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Contr ol.UpdateB ounds()
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Scrol lableContr ol.WndProc (Message& m)
at System.Windows.Forms.Conta inerContro l.WndProc( Message& m)
at System.Windows.Forms.Form. WndProc(Me ssage& m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Unsaf eNativeMet hods.DefFr ameProc(In tPtr hWnd, IntPtr hWndClient, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Form. DefWndProc (Message& m)
at System.Windows.Forms.Contr ol.WmWindo wPosChange d(Message& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Scrol lableContr ol.WndProc (Message& m)
at System.Windows.Forms.Conta inerContro l.WndProc( Message& m)
at System.Windows.Forms.Form. WndProc(Me ssage& m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Unsaf eNativeMet hods.DefFr ameProc(In tPtr hWnd, IntPtr hWndClient, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Form. DefWndProc (Message& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Scrol lableContr ol.WndProc (Message& m)
at System.Windows.Forms.Conta inerContro l.WndProc( Message& m)
at System.Windows.Forms.Form. WmSysComma nd(Message & m)
at System.Windows.Forms.Form. WndProc(Me ssage& m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Unsaf eNativeMet hods.DefFr ameProc(In tPtr hWnd, IntPtr hWndClient, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Form. DefWndProc (Message& m)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Scrol lableContr ol.WndProc (Message& m)
at System.Windows.Forms.Conta inerContro l.WndProc( Message& m)
at System.Windows.Forms.Form. WmNcButton Down(Messa ge& m)
at System.Windows.Forms.Form. WndProc(Me ssage& m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.De buggableCa llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Unsaf eNativeMet hods.Dispa tchMessage W(MSG& msg)
at System.Windows.Forms.Appli cation.Com ponentMana ger.System .Windows.F orms.Unsaf eNativeMet hods.IMsoC omponentMa nager.FPus hMessageLo op(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Appli cation.Thr eadContext .RunMessag eLoopInner (Int32 reason, ApplicationContext context)
at System.Windows.Forms.Appli cation.Thr eadContext .RunMessag eLoop(Int3 2 reason, ApplicationContext context)
at System.Windows.Forms.Appli cation.Run (Applicati onContext context)
at Microsoft.VisualBasic.Appl icationSer vices.Wind owsFormsAp plicationB ase.OnRun( )
at Microsoft.VisualBasic.Appl icationSer vices.Wind owsFormsAp plicationB ase.DoAppl icationMod el()
at Microsoft.VisualBasic.Appl icationSer vices.Wind owsFormsAp plicationB ase.Run(St ring[] commandLine)
at ePerformance.My.MyApplicat ion.Main(S tring[] Args)
at System.AppDomain._nExecute Assembly(A ssembly assembly, String[] args)
at System.AppDomain.ExecuteAs sembly(Str ing assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.Hos tingProces s.HostProc .RunUsersA ssembly()
at System.Threading.ThreadHel per.Thread Start_Cont ext(Object state)
at System.Threading.Execution Context.Ru n(Executio nContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHel per.Thread Start()
InnerException:
This happens randomly when I resize the window or tab that the grid resides on. Why would an index error happen on my datagridview column when I resize the datagridview? I assume this is happening on my datagridview column that is a combo box. I have no resize logic on the datagridview... some kind of helper thread that happens automatically in the background is triggering this.
Here is the full errror:
System.ArgumentOutOfRangeE
Message="Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"
Source="mscorlib"
ParamName="index"
StackTrace:
at System.Collections.ArrayLi
at System.Windows.Forms.DataG
at System.Windows.Forms.DataG
at System.Windows.Forms.DataG
at System.Windows.Forms.DataG
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.DataG
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.DataG
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.SafeN
at System.Windows.Forms.Contr
at System.Windows.Forms.DataG
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Split
at System.Windows.Forms.Split
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Conta
at System.Windows.Forms.Split
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.SafeN
at System.Windows.Forms.Contr
at System.Windows.Forms.Split
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Split
at System.Windows.Forms.Split
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Conta
at System.Windows.Forms.Split
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.SafeN
at System.Windows.Forms.Contr
at System.Windows.Forms.Split
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Panel
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.SafeN
at System.Windows.Forms.Contr
at System.Windows.Forms.TabPa
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.TabCo
at System.Windows.Forms.TabCo
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.TabCo
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.SafeN
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Split
at System.Windows.Forms.Split
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Conta
at System.Windows.Forms.Split
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.SafeN
at System.Windows.Forms.Contr
at System.Windows.Forms.Split
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Conta
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.UserC
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Conta
at System.Windows.Forms.UserC
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.SafeN
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Conta
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.Unsaf
at System.Windows.Forms.Nativ
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.MdiCl
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.Unsaf
at System.Windows.Forms.Nativ
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.MdiCl
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.SafeN
at System.Windows.Forms.Contr
at System.Windows.Forms.MdiCl
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Layou
at System.Windows.Forms.Contr
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Conta
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.Unsaf
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Conta
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.Unsaf
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Conta
at System.Windows.Forms.Form.
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.Unsaf
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Scrol
at System.Windows.Forms.Conta
at System.Windows.Forms.Form.
at System.Windows.Forms.Form.
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
at System.Windows.Forms.Unsaf
at System.Windows.Forms.Appli
at System.Windows.Forms.Appli
at System.Windows.Forms.Appli
at System.Windows.Forms.Appli
at Microsoft.VisualBasic.Appl
at Microsoft.VisualBasic.Appl
at Microsoft.VisualBasic.Appl
at ePerformance.My.MyApplicat
at System.AppDomain._nExecute
at System.AppDomain.ExecuteAs
at Microsoft.VisualStudio.Hos
at System.Threading.ThreadHel
at System.Threading.Execution
at System.Threading.ThreadHel
InnerException:
There is a lot there in the stack trace, but not enough to help explain the error. Without understanding your application and environment better, it would be darn near impossible to help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you handling the DataViewView.Error event?