Issue 213: Unhandled InvalidOperationException

issues
Status:closed
Assigned To:Guest
Type:Defect
Area:Skyline
Priority:3
Milestone:4.3
Opened:2013-01-09 11:54 by Brendan MacLean
Changed:2014-03-04 16:34 by Brendan MacLean
Resolved:2014-01-08 13:17 by Nick Shulman
Resolution:Fixed
Closed:2014-03-04 16:34 by Brendan MacLean
2013-01-09 11:54 Brendan MacLean
Title»Unhandled InvalidOperationException
Assigned To»Nick Shulman
Type»Defect
Area»Skyline
Priority»3
Milestone»1.4
Would be great to fix this in the v1.4 branch, if possible, in case I make another patch release. It seems to happen with some frequency.

User email address: bschilling
User comments:
clicked on precursor note.....

Skyline version: 1.4.1.4225 (64-bit)
Installation ID: d244d95c-f656-4293-81ff-0a5d0c747098
Exception type: System.InvalidOperationException
Error message: This operation cannot be performed while an auto-filled column is being resized.

Stack trace:
   at System.Windows.Forms.DataGridView.PerformLayoutPrivate(Boolean useRowShortcut, Boolean computeVisibleRows, Boolean invalidInAdjustFillingColumns, Boolean repositionEditingControl)
   at System.Windows.Forms.DataGridView.SetColumnHeadersHeightInternal(Int32 columnHeadersHeight, Boolean invalidInAdjustFillingColumns)
   at System.Windows.Forms.DataGridView.AutoResizeColumnHeadersHeight(Boolean fixedRowHeadersWidth, Boolean fixedColumnsWidth)
   at System.Windows.Forms.DataGridView.OnColumnHeadersGlobalAutoSize()
   at System.Windows.Forms.DataGridView.set_TopLeftHeaderCell(DataGridViewHeaderCell value)
   at System.Windows.Forms.DataGridView.get_TopLeftHeaderCell()
   at System.Windows.Forms.DataGridView.GetCellInternal(Int32 columnIndex, Int32 rowIndex)
   at System.Windows.Forms.DataGridView.OnCellMouseEnter(DataGridViewCellEventArgs e)
   at System.Windows.Forms.DataGridView.UpdateMouseEnteredCell(HitTestInfo hti, MouseEventArgs e)
   at System.Windows.Forms.DataGridView.OnColumnWidthChanged(DataGridViewColumnEventArgs e)
   at System.Windows.Forms.DataGridView.AdjustFillingColumns()
   at System.Windows.Forms.DataGridView.ComputeLayout()
   at System.Windows.Forms.DataGridView.PerformLayoutPrivate(Boolean useRowShortcut, Boolean computeVisibleRows, Boolean invalidInAdjustFillingColumns, Boolean repositionEditingControl)
   at System.Windows.Forms.DataGridView.OnHandleCreated(EventArgs e)
   at System.Windows.Forms.Control.WmCreate(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.DataGridView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Exception caught at:
   at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
   at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
   at System.Windows.Forms.Control.CreateHandle()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
   at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at pwiz.Skyline.SkylineWindow.EditNote() in C:\proj\pwiz_x64\pwiz_tools\Skyline\Skyline.cs:line 1286
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at pwiz.Skyline.Program.Main(String[] args) in C:\proj\pwiz_x64\pwiz_tools\Skyline\Program.cs:line 135

2013-01-09 11:57 Brendan MacLean
Apparently, it is not only the Edit Note form that has this problem. Here is a case where it is happening in the PasteDlg form.

2013-01-09 12:07 Nick Shulman
This exception happens if the grid is created, and the mouse cursor is located at a position which will contain the top left square of the grid (i.e. the "select all" box).

We were seeing this in 1.3, and the change that we made for 1.4 was to make it so that ReportErrorDlg includes the callstack where the exception was caught (so that we can see which menu item the user was invoking when they brought it up).

2013-04-02 11:41 Brendan MacLean
Fixing Edit > Note definitely decreased the frequency of this issue, but I have still seen it in other forms that contain grids. Could we possibly bring up and initialize with the grid disabled and then enable the grid based on some later event? Being disabled should keep it from getting mouse input. Just a thought.

2014-01-08 08:11 Brendan MacLean
Milestone1.4»
Would still be nice to figure out a solution other than hiding the record selectors.

2014-01-08 13:17 Nick Shulman
resolve as Fixed
Statusopen»resolved
Assigned ToNick Shulman»Brendan MacLean
DonMarsh fixed this all throughout the product in r5027.
He made it so that "AutoSizeColumnsMode" does not get set to "Fill" until after the form loads.

2014-03-04 16:34 Brendan MacLean
close
Statusresolved»closed
Assigned ToBrendan MacLean»Guest