System.ArgumentOutOfRangeException: 索引超出范围。必须为非负值并小于集合大小。
参数名: index
在 System.Collections.ArrayList.get_Item(Int32 index)
在 System.Windows.Forms.DataGridViewColumnCollection.get_Item(Int32 index)
在 System.Windows.Forms.DataGridView.PositionEditingControl(Boolean setLocation, Boolean setSize, Boolean setFocus)
在 System.Windows.Forms.DataGridView.PerformLayoutPrivate(Boolean useRowShortcut, Boolean computeVisibleRows, Boolean invalidInAdjustFillingColumns, Boolean repositionEditingControl)
在 System.Windows.Forms.DataGridView.ResetUIState(Boolean useRowShortcut, Boolean computeVisibleRows)
在 System.Windows.Forms.DataGridViewRowCollection.OnCollectionChanged_PreNotification(CollectionChangeAction cca, Int32 rowIndex, Int32 rowCount, DataGridViewRow& dataGridViewRow, Boolean changeIsInsertion)
在 System.Windows.Forms.DataGridViewRowCollection.OnCollectionChanged(CollectionChangeEventArgs e, Int32 rowIndex, Int32 rowCount, Boolean changeIsDeletion, Boolean changeIsInsertion, Boolean recreateNewRow, Point newCurrentCell)
在 System.Windows.Forms.DataGridViewRowCollection.ClearInternal(Boolean recreateNewRow)
在 System.Windows.Forms.DataGridView.OnClearingColumns()
在 System.Windows.Forms.DataGridViewColumnCollection.Clear()
在 System.Windows.Forms.DataGridView.Dispose(Boolean disposing)
在 System.ComponentModel.Component.Dispose()
在 System.Windows.Forms.Control.Dispose(Boolean disposing)
在 System.ComponentModel.Component.Dispose()
在 System.Windows.Forms.Control.Dispose(Boolean disposing)
在 System.Windows.Forms.TabControl.Dispose(Boolean disposing)
在 System.ComponentModel.Component.Dispose()
在 System.Windows.Forms.Control.Dispose(Boolean disposing)
在 System.ComponentModel.Component.Dispose()
在 System.Windows.Forms.Control.Dispose(Boolean disposing)
在 System.Windows.Forms.Form.Dispose(Boolean disposing)
参数名: index
在 System.Collections.ArrayList.get_Item(Int32 index)
在 System.Windows.Forms.DataGridViewColumnCollection.get_Item(Int32 index)
在 System.Windows.Forms.DataGridView.PositionEditingControl(Boolean setLocation, Boolean setSize, Boolean setFocus)
在 System.Windows.Forms.DataGridView.PerformLayoutPrivate(Boolean useRowShortcut, Boolean computeVisibleRows, Boolean invalidInAdjustFillingColumns, Boolean repositionEditingControl)
在 System.Windows.Forms.DataGridView.ResetUIState(Boolean useRowShortcut, Boolean computeVisibleRows)
在 System.Windows.Forms.DataGridViewRowCollection.OnCollectionChanged_PreNotification(CollectionChangeAction cca, Int32 rowIndex, Int32 rowCount, DataGridViewRow& dataGridViewRow, Boolean changeIsInsertion)
在 System.Windows.Forms.DataGridViewRowCollection.OnCollectionChanged(CollectionChangeEventArgs e, Int32 rowIndex, Int32 rowCount, Boolean changeIsDeletion, Boolean changeIsInsertion, Boolean recreateNewRow, Point newCurrentCell)
在 System.Windows.Forms.DataGridViewRowCollection.ClearInternal(Boolean recreateNewRow)
在 System.Windows.Forms.DataGridView.OnClearingColumns()
在 System.Windows.Forms.DataGridViewColumnCollection.Clear()
在 System.Windows.Forms.DataGridView.Dispose(Boolean disposing)
在 System.ComponentModel.Component.Dispose()
在 System.Windows.Forms.Control.Dispose(Boolean disposing)
在 System.ComponentModel.Component.Dispose()
在 System.Windows.Forms.Control.Dispose(Boolean disposing)
在 System.Windows.Forms.TabControl.Dispose(Boolean disposing)
在 System.ComponentModel.Component.Dispose()
在 System.Windows.Forms.Control.Dispose(Boolean disposing)
在 System.ComponentModel.Component.Dispose()
在 System.Windows.Forms.Control.Dispose(Boolean disposing)
在 System.Windows.Forms.Form.Dispose(Boolean disposing)
try
{
dgv.Dispose();
}
catch(Exception ex)
{}