After upgrading to version 15.1.6 one of our application is experiencing an issue that causes a StackOverflowException when showing a form with a xtradatalayout bound to an XPCollection with an XPObject loaded.
The message is as follows
C#System.ArgumentException occurred
HResult=-2147024809
Message=Child list for field Articolo! cannot be created.
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.BindingContext.EnsureListManager(Object dataSource, String dataMember)
InnerException:
The call stack is
C# System.Windows.Forms.dll!System.Windows.Forms.BindingContext.EnsureListManager(object dataSource, string dataMember) Unknown
DevExpress.Data.v15.1.dll!DevExpress.Data.Helpers.MasterDetailHelper.GetDataSourceCore(System.Windows.Forms.BindingContext context, object dataSource, string dataMember) Line 1355 C#
DevExpress.Data.v15.1.dll!DevExpress.Data.Helpers.MasterDetailHelper.GetDataSource(System.Windows.Forms.BindingContext context, object dataSource, string dataMember) Line 1346 C#
DevExpress.XtraLayout.v15.1.dll!DevExpress.XtraDataLayout.LayoutElementsBindingInfoHelper.CreateListElementBindingInfoFromFieldList(System.Collections.ICollection dataColumnInfoCollection, string dataMember, System.Collections.Hashtable dataTypeHashtable) Line 951 C#
DevExpress.XtraLayout.v15.1.dll!DevExpress.XtraDataLayout.LayoutElementsBindingInfoHelper.CreateListElementBindingInfoFromFieldList(System.Collections.ICollection dataColumnInfoCollection, string dataMember, System.Collections.Hashtable dataTypeHashtable) Line 951 C#
DevExpress.XtraLayout.v15.1.dll!DevExpress.XtraDataLayout.LayoutElementsBindingInfoHelper.CreateDataLayoutElementsBindingInfo() Line 926 C#
DevExpress.XtraLayout.v15.1.dll!DevExpress.XtraDataLayout.DataLayoutControl.GetLayoutElementsBindingsInfo() Line 401 C#
> DevExpress.XtraLayout.v15.1.dll!DevExpress.XtraDataLayout.DataLayoutControl.OnHandleCreated(System.EventArgs e) Line 125 C#
System.Windows.Forms.dll!System.Windows.Forms.Control.WmCreate(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ContainerControl.WndProc(ref System.Windows.Forms.Message m) Unknown
DevExpress.XtraLayout.v15.1.dll!DevExpress.XtraLayout.LayoutControl.WndProc(ref System.Windows.Forms.Message m) Line 1076 C#
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) Unknown
[Native to Managed Transition]
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(int dwExStyle, string lpszClassName, string lpszWindowName, int style, int x, int y, int width, int height, System.Runtime.InteropServices.HandleRef hWndParent, System.Runtime.InteropServices.HandleRef hMenu, System.Runtime.InteropServices.HandleRef hInst, object pvParam) Unknown
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.CreateHandle(System.Windows.Forms.CreateParams cp) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.CreateHandle() Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.CreateControl(bool fIgnoreVisible) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.CreateControl(bool fIgnoreVisible) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.CreateControl() Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.WmShowWindow(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ContainerControl.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Form.WmShowWindow(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Form.WndProc(ref System.Windows.Forms.Message m) Unknown
DevExpress.Utils.v15.1.dll!DevExpress.XtraEditors.XtraForm.WndProc(ref System.Windows.Forms.Message msg) Line 1411 C#
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) Unknown
[Native to Managed Transition]
[Managed to Native Transition]
DevExpress.Utils.v15.1.dll!DevExpress.Utils.Drawing.Helpers.Win32SubclasserFactory.Win32Subclasser.SubClassProcInner(System.IntPtr hWnd, System.IntPtr Msg, System.IntPtr wParam, System.IntPtr lParam, System.IntPtr uIdSubclass, System.IntPtr dwRefData) Line 2850 C#
[Native to Managed Transition]
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.Control.SetVisibleCore(bool value) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Form.SetVisibleCore(bool value) Unknown
DevExpress.Utils.v15.1.dll!DevExpress.XtraEditors.XtraForm.SetVisibleCore(bool value) Line 1882 C#
System.Windows.Forms.dll!System.Windows.Forms.Control.Visible.set(bool value) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.RunDialog(System.Windows.Forms.Form form) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window owner) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog() Unknown
BlueCashNEXT.Fatturazione.dll!BlueCashNEXT.Fatturazione.AttivitaSvolte.AttivitaSvoltaManager.Edit(System.Guid id) Line 35 C#
The exception is thrown by DevExpress.Data.Helpers.MasterDetailHelper.GetDataSourceCore
This error was not happening with version 15.1.5 of the devexpress library.
Do you have any suggestions ?
Hi Luca,
I assume that you have a many-to-many relationship in your XPO class. But, I can't reproduce this issue on my side. I've attached my project. Would you please provide us with the XPO class you bind to a DataLayoutControl. Do you generate its layout at design time or in code? If possible, modify my project to reproduce the issue.
I do not have a many to many relationship in the class but a one to many. The layout is generated at design time and data source is an xpcollection with the session set vie the resolve session event. The actual unit of work is in a viewmodel object.
The strange thing is that all forms with this kind if databinding have stopped working. What is making me wonder is the name of the filed, for example "Child list for field ModalitaFatturazioneAttiva! cannot be created", ModalitaFatturazioneAttiva is the field name on my object and the binding is on the "!Key" part.
Could I have done something wrong with the databinding ? I have always bound this way in LookupEdit controls (most of these bindings are in this kind of control).
Sadly I am not able to reproduce the same error at the moment (it's midnight here), tomorrow I'll take some time and try to reproduce it in tour code if you have no more suggestions for me.
Thanks
Hello Luca,
Thank you for the clarification. We already have fixed this error and the fix will be included into the next maintenance update. Refer to the following ticket for details: DataLayoutControl throws ArgumentException (The DataMember property cannot be found in DataSource) on binding.
I have installed the hotfix present in the ticket you linked but the problem is not resolved and I have no PDB to debug the error.
Thank you for the update, Luca. I presume that we might overlook some specific scenario when fixed this bug. Is it possible that you send us your persistent classes source code? I will analyze it and try to determine the cause of the error.
after postiong the sourcecode i tried to make a new form from scratch with just a datalyaoutcontrol and an xpcollection with objeclclassinfo of BlueCashNEXT.Data.Transazioni.Transazione.
As soon as I select the datasource for the DataLayoutControl and set it to the XPCollection visual studio crashes.
Hey DevExpress,
I encounter the same (or at least a similar) problem.
Is there any approach to this behaviour?
Visual studio still crashes opening the designer and the application throws the same exception after upgrading to version 1.7.
I don't think this problem is solved, not entirely anyway.
Any update or workaround I can use ?