- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using a block table to recall some parameters based on block vis state.
However, once I've changed one or two cells, it then throws an 'unhandled exception' every time I try to click on another cell, scroll or do anything else - apparently "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"
I'm pulling my hair out because I can't seem to find a way past it to carry on with work.
Has anyone seen this before?
More details:
Application does not support just-in-time (JIT)
debugging. See the end of this message for details.
************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at Autodesk.AutoCAD.AuthoringEnvironment.BlockPropertiesTableDialog.mMainGrid_CellParsing(Object sender, DataGridViewCellParsingEventArgs e)
at System.Windows.Forms.DataGridView.OnCellParsing(DataGridViewCellParsingEventArgs e)
at System.Windows.Forms.DataGridView.PushFormattedValue(DataGridViewCell& dataGridViewCurrentCell, Object formattedValue, Exception& exception)
at System.Windows.Forms.DataGridView.CommitEdit(DataGridViewCell& dataGridViewCurrentCell, DataGridViewDataErrorContexts context, DataGridViewValidateCellInternal validateCell, Boolean fireCellLeave, Boolean fireCellEnter, Boolean fireRowLeave, Boolean fireRowEnter, Boolean fireLeave)
at System.Windows.Forms.DataGridView.EndEdit(DataGridViewDataErrorContexts context, DataGridViewValidateCellInternal validateCell, Boolean fireCellLeave, Boolean fireCellEnter, Boolean fireRowLeave, Boolean fireRowEnter, Boolean fireLeave, Boolean keepFocus, Boolean resetCurrentCell, Boolean resetAnchorCell)
at System.Windows.Forms.DataGridView.OnValidating(CancelEventArgs e)
at System.Windows.Forms.Control.NotifyValidating()
at System.Windows.Forms.Control.PerformControlValidation(Boolean bulkValidation)
at System.Windows.Forms.ContainerControl.ValidateThroughAncestor(Control ancestorControl, Boolean preventFocusChangeOnError)
at System.Windows.Forms.ContainerControl.UpdateFocusedControl()
at System.Windows.Forms.ContainerControl.AssignActiveControlInternal(Control value)
at System.Windows.Forms.ContainerControl.ActivateControlInternal(Control control, Boolean originator)
at System.Windows.Forms.Control.WmSetFocus(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Solved! Go to Solution.