Hello,
I have to create dynamically several UltraExpandableGroupBox. All of them are inserted into a .NET FlowLayoutPanel just after been created.My FlowLayoutPanel is docked in my form and I want my UltraExpandableGroupBox resize automatically (specially the Horizontal size) into the FlowLayoutPanel when the user change the form size. Unfortunatly, my UltraExpandableGroupBox never resize even when the FlowLayoutPanel resize itself.Here is a sample of my code. Thanks if anyone can help me to find out what to do.
UltraExpandableGroupBox uegb = new UltraExpandableGroupBox(); UltraExpandableGroupBoxPanel panel = new UltraExpandableGroupBoxPanel(); MyUsercontrol uc = new MyUsercontrol();
((ISupportInitialize)uegb).BeginInit(); uegb.SuspendLayout(); panel.SuspendLayout();
uc.Presenter = _presenter; uc.Dock = DockStyle.Top; uc.BuildAndBindFields(container, regroupement); // build MyUserconrol content.
// box
uegb.Controls.Add(panel); uegb.Dock = DockStyle.Top; uegb.MinimumSize = new System.Drawing.Size(685, 24); uegb.ExpandedSize = new System.Drawing.Size(685, 500); uegb.ExpansionIndicator = Infragistics.Win.Misc.GroupBoxExpansionIndicator.Far; uegb.Location = new System.Drawing.Point(3, 3); uegb.Text = container.GetTraduction(regroupement); uegb.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.Office2003; uegb.Expanded = false;
// panel
panel.Controls.Add(uc); panel.AutoScroll = true; panel.Dock = System.Windows.Forms.DockStyle.Fill; panel.Location = new System.Drawing.Point(2, 22); panel.Size = new System.Drawing.Size(681, 426);
((ISupportInitialize)(uegb)).EndInit(); panel.ResumeLayout(false); uegb.ResumeLayout(false);
Thanks Matt...
I've only been using the Infragistics controls for a month now and was sorta thown into the fire with them. Basically, I was trying to get the UltraGroupBox to AutoSize (vertically in my case) to the size needed to display its child controls. Like the built in "Panel" does... Or like an HTML TableCell does.
Am I using the wrong control for this?
-D
I'm not sure what you mean by a fix; this is not a supported feature of either the GroupBox or the ExpandableGroupBox, so there is no bug here. You could certainly submit a feature request through Developer Support to have this implemented.
-Matt
I was able to get the UltraGroupBox to "AutoSize", but it was a hack.
private void BuildMyControl(){ UltraGroupBox ugb = new UltraGroupBox(); ugb.Dock = DockStyle.Top; this.Controls.Add(ugb); ugb.Text = "My Control"; Panel pnl = new Panel(); pnl.AutoSize = true; pnl.Dock = DockStyle.Top; pnl.Top = 21; // Make room for the header ugb.Controls.Add(pnl); //... // Add whatever controls you want to the Panel, not the GroupBox //... ugb.Height = pnl.Top + pnl.Height;}
It got the job done for me... I would like to know of a fix for this, though...
Is this a bug? I am unable to get my controls to resize inside a flow layout panel as well.
Were you able to find a solution to this? I have similar problem in that I have a expandablegroup box inside an expandable group box but the top level box never resizes after the nested box changes its expanded state.