When trying to view columns for any band besides Invoice, I get the attached error. We are using NHibernate for our business objects and the child bands (Detail, NonStockItems, DistributedApproval) are HasMany collections of the Invoice object.
Any thoughts?
Here's the text of the exception:
System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.BeginInvoke(Delegate method, Object[] args)
at Infragistics.Win.UltraWinGrid.Design.ColumnEditorPageControl.lvColumns_SelectedIndexChanged(Object sender, EventArgs e)
at Infragistics.Win.UltraWinGrid.Design.ColumnEditorPageControl.LoadColumnsList(Int32 indexToSelect)
at Infragistics.Win.UltraWinGrid.Design.ColumnEditorPageControl.Initialize(ColumnsCollection columns)
at Infragistics.Win.UltraWinGrid.Design.ColumnEditorPageControl..ctor(ColumnsCollection columns)
at Infragistics.Win.UltraWinGrid.Design.UltraGridDesignerDialog.SetTabPageFromTreeNode(UltraTreeNode node)
at Infragistics.Win.UltraWinGrid.Design.UltraGridDesignerDialog.treeView1_AfterSelect(Object sender, SelectEventArgs e)
at Infragistics.Win.UltraWinTree.UltraTree.OnAfterSelect(SelectEventArgs e)
at Infragistics.Win.UltraWinTree.UltraTree.FireEvent(TreeEventIds id, EventArgs e)
at Infragistics.Win.UltraWinTree.UltraTree.SelectNewSelection(SelectedNodesCollection selected, Boolean isRangeSelect, Boolean invalidate)
at Infragistics.Win.UltraWinTree.UltraTree.Infragistics.Win.ISelectionManager.SelectItem(ISelectableItem item, Boolean clearExistingSelection)
at Infragistics.Win.SelectionStrategySingle.OnMouseDown(ISelectableItem item, MouseMessageInfo& msginfo, Boolean forceDrag)
at Infragistics.Win.SelectionStrategySingle.OnMouseDown(ISelectableItem item, MouseMessageInfo& msginfo)
at Infragistics.Win.SelectionStrategySingle.OnMouseMessage(ISelectableItem item, MouseMessageInfo& msginfo)
at Infragistics.Win.ControlUIElementBase.ProcessMouseDownHelper(Object sender, MouseEventArgs e)
at Infragistics.Win.ControlUIElementBase.ProcessMouseDown(Object sender, MouseEventArgs e)
at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e)
at Infragistics.Win.UltraWinTree.UltraTree.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.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)
Hello,
I have logged this as a development issue with an ID# of 94709. I will make another post on this thread once the issue has been resolved. Please note that the issue will only be resolved in NetAdvantage 2010 Volume 3 and later since earlier versions are no longer being maintained.
Hi Mikel,
Thanks for the sample. I tried it out and I get the same results. I am going to forward this over to Infragistics Developer Support so they can create a case for you and write this issue up for developer review.
I have encountered a similar problem (although I am not using NHibernate).
I am attaching a simple project that demonstrates the problem.
Here's what I do to make it happen:
1. Open the form that contain the grid.
2. Click on the grid's Start button, to open the designer.
3. Expand the "Band and Column" settings for the first band ('PrintLayout').
4. Expand the second band ('Records').
5. Click on "Columns", under the band - the exception occurs.
Hi,
I tried opening your sample project, but I cannot open the form because your project is referencing some assemblies that I don't have.
I can't see how this error could be caused by the data source, though. The Stack trace shows you are getting an exception because the handle of the control you just clicked on doesn't have a handle, yet, which does not seem possible. The DataSource doesn't even enter into it, unless maybe your DataSource is somehow causing some kind of interference in the controls on the designer dialog.
Are you able to reproduce the same error if you bind the grid to, for example, an UltraDataSource component with the same structure as the NHibernate data source you are using?
Here's a simple example. I created a new project, referenced my business objects, added a grid and bound the grid to the invoice object. If you go into the "Bands and Columns" portion of the grid designer, expand the "Detail" band and click columns, the error will occur.