Hi -
In my solution I am using PopupControlContainer in the toolbar to host my custom control. My control is very simple - it has a datagrid and click on a cell I launch a dialog. But I get following crash as soon as the dialog is loaded. I have tried many things e.g. closing popup before closing loading the dialog, sleep for 1 sec but no luck so far.
Any idea what's going wrong here?
Thanks, -Manish
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'DropDownForm'.
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.ToolTip.get_CreateParams()
at System.Windows.Forms.ToolTip.CreateHandle()
at System.Windows.Forms.ToolTip.Hide(IWin32Window win)
at System.Windows.Forms.DataGridView.DataGridViewToolTip.Activate(Boolean activate)
at System.Windows.Forms.DataGridView.ActivateToolTip(Boolean activate, String toolTipText, Int32 columnIndex, Int32 rowIndex)
at System.Windows.Forms.DataGridViewCell.OnMouseLeaveInternal(Int32 rowIndex)
at System.Windows.Forms.DataGridView.OnCellMouseLeave(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.OnBandThicknessChanged(DataGridViewBand dataGridViewBand)
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.AutoResizeColumnInternal(Int32 columnIndex, DataGridViewAutoSizeColumnCriteriaInternal autoSizeColumnCriteriaInternal, Boolean fixedHeight)
at System.Windows.Forms.DataGridView.AutoResizeAllVisibleColumnsInternal(DataGridViewAutoSizeColumnCriteriaInternal autoSizeColumnCriteriaFilter, Boolean fixedHeight)
at System.Windows.Forms.DataGridView.OnColumnHeadersGlobalAutoSize()
at System.Windows.Forms.DataGridView.OnColumnHeadersDefaultCellStyleChanged(EventArgs e)
at System.Windows.Forms.DataGridView.OnCellStyleContentChanged(DataGridViewCellStyleContentChangedEventArgs e)
at System.Windows.Forms.DataGridView.OnCellStyleContentChanged(DataGridViewCellStyle dataGridViewCellStyle, DataGridViewCellStylePropertyInternal property)
at System.Windows.Forms.DataGridViewCellStyle.OnPropertyChanged(DataGridViewCellStylePropertyInternal property)
at System.Windows.Forms.DataGridViewCellStyle.set_Font(Font value)
at System.Windows.Forms.DataGridView.OnFontChanged(EventArgs e)
at System.Windows.Forms.Control.OnParentFontChanged(EventArgs e)
at System.Windows.Forms.Control.OnFontChanged(EventArgs e)
at System.Windows.Forms.ContainerControl.OnFontChanged(EventArgs e)
at System.Windows.Forms.Control.AssignParent(Control value)
at System.Windows.Forms.Control.ControlCollection.Remove(Control value)
at System.Windows.Forms.Control.set_ParentInternal(Control value)
at System.Windows.Forms.Control.set_Parent(Control value)
at Infragistics.Win.UltraWinToolbars.ToolbarsManagerUtilities.SetParent(Control control, Control newParent)
at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.ReparentControl(Control control, Control newParent, ToolBase rootTool)
at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.InternalSetToolWithControlHelper(ToolBase tool, ToolBase rootTool, UltraToolbarsDockArea dockArea)
at Infragistics.Win.UltraWinToolbars.ToolBase.SetToolWithContainedControl(Boolean takeControlOwnership, UltraToolbarsDockArea dockArea)
at Infragistics.Win.UltraWinToolbars.PopupControlContainerAgent.ReleaseContainedControl()
at Infragistics.Win.UltraWinToolbars.PopupControlContainerAgent.OnPopupClosed(Object sender, EventArgs e)
at Infragistics.Win.DropDownManager.Close()
at Infragistics.Win.DropDownManager.InternalCloseDropDown(Control owner)
at Infragistics.Win.DropDownManager.CloseDropDown(Control owner)
at Infragistics.Win.DropDownManager.DropDownFormBase.DelayedCloseOnDeactivate()
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
It looks like the Form is being disposed while the popup is open, but if you say this is happening when the dialog is loading, it sounds like a bug. I would recommend submitting it to the support group: http://www.infragistics.com/gethelp.