Hello everyone,
I recently moved from V12.2 to V13.1 and I am getting the following error:
An error occurred creating the form. See Exception.InnerException for details. The error is: The Controls collection of the UltraPanel is read-only. Modify the UltraPanel.ClientArea.Controls collection instead.
When I click on the call stack, I find:
at Infragistics.Win.Misc.UltraPanel.UltraPanelControlCollection.Add(Control value)at System.Windows.Forms.Design.ControlDesigner.DesignerControlCollection.Add(Control c)
When I click "view detail", I get:
{"An error occurred creating the form. See Exception.InnerException for details. The error is: The Controls collection of the UltraPanel is read-only. Modify the UltraPanel.ClientArea.Controls collection instead."}
When I click copy exception detail to the clipboard, I get:
System.InvalidOperationException was unhandled HResult=-2146233079 Message=An error occurred creating the form. See Exception.InnerException for details. The error is: The Controls collection of the UltraPanel is read-only. Modify the UltraPanel.ClientArea.Controls collection instead. Source=D4 I2C Reader StackTrace: at D4_I2C_Reader.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190 at D4_I2C_Reader.My.MyProject.MyForms.get_Main() at D4_I2C_Reader.My.MyApplication.OnCreateMainForm() in C:\Users\JBrookley\Documents\TFS Local\D4 Digital Reader\D4 Digital Reader\D4 I2C Reader\My Project\Application.Designer.vb:line 35 at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at D4_I2C_Reader.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: System.InvalidOperationException HResult=-2146233079 Message=The Controls collection of the UltraPanel is read-only. Modify the UltraPanel.ClientArea.Controls collection instead. Source=Infragistics4.Win.Misc.v13.1 StackTrace: at Infragistics.Win.Misc.UltraPanel.UltraPanelControlCollection.Add(Control value) at D4_I2C_Reader.Main.InitializeComponent() in C:\Users\JBrookley\Documents\TFS Local\D4 Digital Reader\D4 Digital Reader\D4 I2C Reader\Main.Designer.vb:line 300 at D4_I2C_Reader.Main..ctor() in C:\Users\JBrookley\Documents\TFS Local\D4 Digital Reader\D4 Digital Reader\D4 I2C Reader\Main.vb:line 9 InnerException:
Honestly, since it will no longer load up correctly (no idea what happened/what I did, it used to work just fine and I don't think anything has changed apart from my Infragistics version), I don't really know what to change or where to start. Can anyone point me in the right direction? I'm guessing the answer is in the last bit of info I pasted but I'm having trouble reading what it's trying to tell me.
If you need any additional information, let me know. Thanks!
The infragistics update utility has never worked on my projects for years now. I spent many hours trying to get someone to help me resolve this but was not successful. It would just generate some generic error message with no detail to help track down what the problem was. Since then every time I have to manually update all the libraries every time there is a new version.. a process that takes a long time because it is a large project.
I tried the change you suggested at the top post but I get an error about a circular reference if I change the line to this: this.ultraPanel1.Controls.Add(this.ultraPanel1.ClientArea);
So, I just commented out those line.
Now I see this error but there is no mention of this method anywhere in my source code:
There shouldn't be any controls added directly to the UltraPanel. The ClientArea gets added to it, but that happens internally and shouldn't exist in the designer code.
What seems to be happening in a lot of these cases is that for some reason, Visual Studio can't find the Design assembly (which is basically the assembly in the GAC that provides designers and in this case handles telling the UltraPanel not to serialize out the ClientArea control). This can happen if you upgrade your Infragistics controls without running the proper installer, like just copying the assemblies onto your machine manually. Or, if there's a bug or a failure in the installer which doesn't correctly install the design assembly. And once the designer file get corrupted like this, the only thing you can do is fix it manually as noted by the instructions above.
I also suddenly started getting this error. Looking back this line did not exist in the designer in older versions, and I seem to be able to comment the line out and it works but one of the unnbound columns in my grid is also missing like it wasn't persisted to source control.
Hello I know this is an old thread but it was the first I found here,
Has it been determined as to why this issue happens?
I just had this happen to me and I had to comment out the line and rebuild to get my designer back. 'Me.TestForm_Fill_Panel.Controls.Add(Me.TestForm_Fill_Panel.ClientArea)
Now I am thinking that TestForm_Fill_Panel is the panel that gets added when dropping a dock control like UltraToolbarManager on to a form.
So what is the cause for the designer to start throwing these errors?
In the past when I have added controls like the UltraToolbarManager and presented with the option to 'Add an UltraPanel control', I have always chosen 'Do no add a container control'. New company, new version of Infragistics, new product and I decide to to add the UltraPanel and bang. I can't have this happen to other developers or my manager who may open this project.
Would just like to know so I can stop doing what I did here.
Thanks
Hello Jeremy,
I created a private case for you with reference number CAS-127901-X8K5Q1 . You could find this case at: https://ko.infragistics.com/my-account/support-activity/ Please feel free to write me.
Regards