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
350
UltraExpandableGroupBox.Panel is null
posted

 Hi there,

 I'm looking to use this snippet: http://help.infragistics.com/Help/NetAdvantage/NET/2007.2/CLR2.0/html/Infragistics2.Win.Misc.v7.2~Infragistics.Win.Misc.UltraExpandableGroupBox.html

 But i've got a problem because my UltraExpandableGroupBox is code generated. I'm looking after the Panel attribute ut this one is null.

UltraExpandableGroupBox uegb = new UltraExpandableGroupBox();
uegb.Panel.Controls.Add(myControl);

 And so I've a NullReferenceException.

I tried this too:

UltraExpandableGroupBox uegb = new UltraExpandableGroupBox();
UltraExpandableGroupBoxPanel panel = new UltraExpandableGroupBoxPanel();
uegb.Panel = panel;

But I got this compilation error:  Property or indexer 'Infragistics.Win.Misc.UltraExpandableGroupBox.Panel' cannot be assigned to -- it is read only 

 

Please help!

Parents
No Data
Reply
  • 37774
    posted

    The UltraExpandableGroupBox will not create its panel until it gets the OnCreateControl method called; this behavior was originally implemented due to the fact that the panel cannot be created when the control is during at design-time due to the registration process and some issues that arose then.

    There is a protected virtual method that was implemented for the case that you are currently stuck at.  What you should do is derive your own class from UltraExpandableGroupBox and override the OnPanelInitialized method, where you can then add your controls to the panel.

    -Matt

Children