Hi,
I am working with a DataGridView in a child form, if I cancel the childform with the follwing code:
DialogResult = Windows.Forms.DialogResult.Cancel
Then I get the following exception:
KeyNotFoundException
The given key was not present in the dictionary.
Source : mscorlib
Stack Trace:
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at MicroFour.StrataFrame.Business.BusinessLayer.get__CurrentDataTable(Boolean IsSharedTable)
at MicroFour.StrataFrame.Business.BusinessBindingSource.RemoveBOHandlers()
at MicroFour.StrataFrame.Business.BusinessBindingSource.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.ComponentModel.Container.Dispose(Boolean disposing)
at System.ComponentModel.Container.Dispose()
at CardTrackingSystem.frmActivateCardsItems.Dispose(Boolean disposing) in E:\Visual Studio 2008 Projects\StrataFrame\Card Tracking System Projects\CardTrackingSystem.NET\CTS Solution\Card Tracking System\Dialogs\Transaction Forms\Activate Cards\frmActivateCardsItems.Designer.vb:line 10
at System.Windows.Forms.Form.Close()
at MicroFour.StrataFrame.UI.Windows.Forms.ChildFormDialog.ShowDialog(Object[] Arguments)
at MicroFour.StrataFrame.UI.Windows.Forms.ChildFormDialog.ShowDialog()
at CardTrackingSystem.frmActivateCards.cmdAddCards_Click(Object sender, EventArgs e) in E:\Visual Studio 2008 Projects\StrataFrame\Card Tracking System Projects\CardTrackingSystem.NET\CTS Solution\Card Tracking System\Dialogs\Transaction Forms\Activate Cards\frmActivateCards.vb:line 800
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.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.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The DataGridView is being populated with a BBS and the error only happens if the grid has some data. I don't know what "Key" it may be looking for? Also I would like to note that the BO assigned to the BBS has come Custom Field Properties which are not used in the DataGridView.
Edhy Rijo