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!
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
Hi Matt and thanks for your answer.
Should I do like that?
class CustomUltraExpandableGroupBox : UltraExpandableGroupBox{ protected override void OnPanelInitialized() { base.OnPanelInitialized(); //Ajout du panel this.Panel = new UltraExpandableGroupBoxPanel(); }}
I got the same problem anymore...