GroupBox AutoSize issue

4 posts, 0 answers
  1. Jacky
    Jacky avatar
    23 posts
    Member since:
    Mar 2014

    Posted 29 Aug 2014 Link to this post

    hi telerik, 
    thanks for your help in advance.

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

     1. drag a radgroupbox into form
     2. drag 3 radpanels into radgroupbox
     3. set the 3 radpanels' dock =
     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 ?
  2. George
    George avatar
    500 posts

    Posted 03 Sep 2014 Link to this post

    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.

    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.
  3. DevCraft R3 2016 release webinar banner
  4. Laszlo
    Laszlo avatar
    3 posts
    Member since:
    Jan 2015

    Posted 30 Jan 2015 in reply to George Link to this post

    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,
  5. Dess
    Dess avatar
    1561 posts

    Posted 03 Feb 2015 Link to this post

    Hello Laszlo,

    Thank you for writing.

    I have tried to reproduce the problem you are facing. Here is my sample code snippet:
    public Form1()
        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.


    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.

Back to Top