This is a migrated thread and some comments may be shown as answers.

GroupBox AutoSize issue

6 Answers 275 Views
GroupBox
This is a migrated thread and some comments may be shown as answers.
Jacky
Top achievements
Rank 1
Jacky asked on 29 Aug 2014, 10:40 AM
hi telerik, 
thanks for your help in advance.

the groupbox is bigger and bigger when i set autosize =true.

steps.
 1. drag a radgroupbox into form
 2. drag 3 radpanels into radgroupbox
 3. set the 3 radpanels' dock = dockstyle.top
 4. set radgroupbox. autosize = true
 5. drag a radbutton into form and out of radgroupbox
 6. add click eventhandler to radbotton with below code
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    RadPanel2.Visible = Not RadPanel2.Visible
End Sub
 7.  run app,  click the button continuously,  you can find the width of groupbox is bigger and bigger.

what is wrong and how to avoid ?

6 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 03 Sep 2014, 08:45 AM
Hi Jacky,

Thank you for writing.

I can confirm that the size of the RadGroupBox increases when you show/hide the RadPanel inside. I have logged the issue in our Feedback Portal on the following address: UI for Winforms Feedback Portal - FIX. RadGroupBox - Showing and hiding a panel inside the groupbox when its AutoSize property is set to true causes it to change its size.

Since the AutoSize behavior cannot be worked around I would recommend to you to set it to false and prior to showing/hiding the RadPanel to change the size of the RadGroupBox.

I have updated your Telerik Points for reporting this.

Let me know, should you have other questions.

Regards,
George
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Laszlo
Top achievements
Rank 1
answered on 30 Jan 2015, 07:56 AM
Hi George,

I have a similar issue than Jacky have with the GroupBox. If I set the AutoSize property to true and I set the Padding property for example to (2,18,2,2), the GroupBox height will be more than expected. It seems to me, that the Top padding value will be added twice, as if I set it for example to 18 too. I have attached the result of this parameters. Could you explain me please how can I avoid this side effect?

Thanks in advance,
Laszlo
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Feb 2015, 03:52 PM
Hello Laszlo,

Thank you for writing.

I have tried to reproduce the problem you are facing. Here is my sample code snippet:
public Form1()
{
    InitializeComponent();
 
    this.radGroupBox1.AutoSize = true;
    this.radGroupBox1.Padding = new Padding(2, 30, 5, 5);
 
    this.radPanel1.BackColor = Color.Red;
    this.radPanel1.Dock = DockStyle.Fill;
    this.radPanel1.Size = new Size(200, 80);
 
    this.radGroupBox2.AutoSize = true;
    this.radGroupBox2.Padding = new Padding(5, 18,10, 15);
    this.radTrackBar1.Dock = DockStyle.Fill;
    this.radTrackBar1.AutoSize = false;
    this.radTrackBar1.Size = new Size(200, 80);
}

Both of RadGroupBox controls have correct padding when the inner control fills the entire content. Please find the attached screenshot. Could you please provide your sample code replicating the undesired behavior? Thank you in advance.

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Dess
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Marc
Top achievements
Rank 1
Veteran
answered on 09 Mar 2018, 12:08 PM

Hey,

I'm using a CollapbisblePanel inside my GroupBox.

AutoSize = true, but the GroupBox doesn't grow, if I collaps the panel.

 

Kind regards

0
Marc
Top achievements
Rank 1
Veteran
answered on 09 Mar 2018, 12:13 PM

One more information, I set the fill of CollapsiblePanel to Dock.

Now I removed fill and it works.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Mar 2018, 09:13 AM
Hello, Marc,

Thank you for writing.  
 
I am glad that the problem you were facing is now resolved. Indeed, when you set the Dock property of RadCollapsiblePanel to Fill it will be sized according to parent's container. That is why when you collapse the panel, the group box is shrunk as well because it is auto sized. Don't set the Dock property to Fill for the RadCollapsiblePanel and it it will expand/collapse with the collapsible panel.

I hope this information helps. Should you have further questions I would be glad to help. 
 
 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GroupBox
Asked by
Jacky
Top achievements
Rank 1
Answers by
George
Telerik team
Laszlo
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Marc
Top achievements
Rank 1
Veteran
Share this question
or