Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
UltraPanel client area read-only
posted

Winforms 2011.2 at the moment but doesn't seem to matter what version.

Trying to open a windows form in Visual Studio 2012 pro (c#) and getting errors that the UltraPanel is read-only and when trying to build it generates:

"The Controls collection of the UltraPanel is read-only.  Modify the UltraPanel.ClientArea.Controls collection instead." and it highlights this section of code in the designer file:

this.pnlLeft.Controls.Add(this.pnlLeft.ClientArea);

Changing to ClientArea like the error suggests, errors out with a circular error.

What is going on here?

Parents
No Data
Reply
  • 4618
    Suggested Answer
    posted

    Hi Admin,

    The controls collection extended directly off of the UltraPanel object is read only; if you intend to programmatically add any controls to its collection, you will need to access the Add() method of the ClientArea of the panel instead, (ultraPanel1.ClientArea.Controls.Add(<controlToAdd>)).

    It is not necessary to add the client area of the panel to its controls collection and this is certainly the cause of your circular reference.

    I recommend commenting out this line altogether, (this.pnlLeft.Controls.Add(this.pnlLeft.ClientArea)) and assuming that the desired controls are being added to the controls collection as I mentioned above and that the UltraPanel has already been added to the controls collection of the form, then your project should build successfully.

    If you have any further questions, please let me know.

    Sincerely,
    Chris K
    Developer Support Engineer
    Infragistics, Inc.
    www.infragistics.com/support

Children