Bug Report T288096
Visible to All Users

DataLayoutControl throws ArgumentException when bound to the XPCollection

created 9 years ago

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 ?

Show previous comments (6)
PB PB
Peter Böckmann 9 years ago

    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 ?

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

        Additional information:

        We have managed to reproduce this problem and determined its cause. The fix for this problem will be included in the next maintenance update. As a temporary workaround, open the XPCollection.DisplayableProperties property editor and remove all properties with a name containing an exclamation sign.

          Show previous comments (3)
          DevExpress Support Team 9 years ago

            Hello Luca,

            Please accept my apologies for the delay in response. We have not managed to reproduce the error in the latest version of our components. Since it is urgent, we will make more efforts to research this issue. For this intent, we need some information from you. Specifically, we need to clarify the following:

            1. Is the stack trace of the exception raised at run-time exactly the same as the one you posted in the first message? If not, please send us the complete stack trace.

            2. Does the temporary workaround provided in the Additional Information section of the Solution item work in your case? I mean the following sentence: "As a temporary workaround, open the XPCollection.DisplayableProperties property editor and remove all properties with a name containing an exclamation sign".

            3. In the latest version, the new AllowGeneratingNestedGroups option was added to the LayoutControl. Did you by chance modified this property value or left its default value unchanged?

            4. Is the DataLayoutControl.AutoRetrieveFields option enabled?

            I am looking forward to hearing from you.

              No properties are listed in the xpcollection and the options on the datalayoutcntrol are not set.
              This is the call stack with the latest versions
              mscorlib.dll!System.Array.Resize<System.Reflection.PropertyInfo>(ref System.Reflection.PropertyInfo[] array, int newSize) Unknown
              mscorlib.dll!System.RuntimeType.ListBuilder<System.Reflection.PropertyInfo>.ToArray() Unknown
              mscorlib.dll!System.RuntimeType.GetProperties(System.Reflection.BindingFlags bindingAttr) Unknown
              > DevExpress.XtraLayout.v15.1.dll!DevExpress.XtraDataLayout.LayoutElementsBindingInfoHelper.IsSimpleType(System.Collections.Hashtable dataTypeHashtable, System.Type dataType) Line 990 C#
              DevExpress.XtraLayout.v15.1.dll!DevExpress.XtraDataLayout.LayoutElementsBindingInfoHelper.IsSimpleType.AnonymousMethod__8(System.Reflection.PropertyInfo p) Line 991 C#
              System.Core.dll!System.Linq.Enumerable.Any<System.Reflection.PropertyInfo>(System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo> source, System.Func<System.Reflection.PropertyInfo, bool> predicate) Unknown
              The last 3 lines just repeats undefinetely, and this is the exception
              System.StackOverflowException was unhandled
               HResult=-2147023895
               Message=Exception of type 'System.StackOverflowException' was thrown.
               InnerException:

              C#
              // // src (the XPCollection) // this.src.LoadingEnabled = false; this.src.ObjectType = typeof(BlueCashNEXT.Data.Gestione.AttivitaSvolta); this.src.ResolveSession += new DevExpress.Xpo.ResolveSessionEventHandler(this.src_ResolveSession); // // layoutControl // this.layoutControl.Controls.Add(this.OperatoreLookupEdit); this.layoutControl.Controls.Add(this.AziendaLookupEdit); this.layoutControl.Controls.Add(this.AttivitaLookupEdit); this.layoutControl.Controls.Add(this.ClienteLookupEdit); this.layoutControl.Controls.Add(this.ProgettoLookupEdit); this.layoutControl.Controls.Add(this.DataDateEdit); this.layoutControl.Controls.Add(this.DescrizioneMemoEdit); this.layoutControl.Controls.Add(this.NoteMemoEdit); this.layoutControl.Controls.Add(this.QuantitaSpinEdit); this.layoutControl.Controls.Add(this.SospendiFatturazioneToggleSwitch); this.layoutControl.Controls.Add(this.TariffaPersonalizzataSpinEdit); this.layoutControl.Controls.Add(this.ReferenteComboBoxEdit); this.layoutControl.DataSource = this.src; this.layoutControl.Dock = System.Windows.Forms.DockStyle.Fill; this.layoutControl.Location = new System.Drawing.Point(0, 24); this.layoutControl.Name = "layoutControl"; this.layoutControl.OptionsPrint.AppearanceGroupCaption.BackColor = System.Drawing.Color.LightGray; this.layoutControl.OptionsPrint.AppearanceGroupCaption.Font = new System.Drawing.Font("Tahoma", 10.25F); this.layoutControl.OptionsPrint.AppearanceGroupCaption.Options.UseBackColor = true; this.layoutControl.OptionsPrint.AppearanceGroupCaption.Options.UseFont = true; this.layoutControl.OptionsPrint.AppearanceGroupCaption.Options.UseTextOptions = true; this.layoutControl.OptionsPrint.AppearanceGroupCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; this.layoutControl.OptionsPrint.AppearanceGroupCaption.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; this.layoutControl.OptionsPrint.AppearanceItemCaption.Options.UseTextOptions = true; this.layoutControl.OptionsPrint.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; this.layoutControl.OptionsPrint.AppearanceItemCaption.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; this.layoutControl.Root = this.Root; this.layoutControl.Size = new System.Drawing.Size(602, 366); this.layoutControl.TabIndex = 5; this.layoutControl.Text = "dataLayoutControl1";
              DevExpress Support Team 9 years ago

                Hello Luca,

                Thank you for the additional information. It was sufficient to understand what the problem is. This error is different than the error that you described in the initial post. To process this issue more efficiently, I created a separate ticket on your behalf: T296826: DataLayoutControl throws StackOverflowException under certain circumstances. I have passed this ticket to our R&D team for research.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.