RadGroupBox BackColor from Form insead of RadPage

4 posts, 0 answers
  1. dario
    dario avatar
    9 posts
    Member since:
    Dec 2008

    Posted 04 Jun 2011 Link to this post

    Hello.
    I have RadGroupBox control placed on RadPageView. The problem is with RadGroupBox colors: in desing mode everything is ok (see desinger.PNG from atachement), but when I run my application, the BackColor of RagGroupBox seems to be from main form instead of PadPage (see running.PNG), so it looks strange.

    How to fix this problem?

    (version Q1 2011, WinForms)

    Thanks in advance.
    Darek.
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 09 Jun 2011 Link to this post

    Hello Dariusz.

    Thank you for writing.

    RadGroupBox as every other control traverses its parents until it finds a parent with a explicitly set Backcolor property. If such is not found, it will take it from the form since it is the last parent in the hierarchy of controls. Just like in your case, where the group box color is taken from the form, since the RadPageViewPage and RadPageView Backcolors are not explicitly set and they hold their default values. 

    If you want the group box to take the color from the RadPageViewPage, simply set the group box Backcolor to Transparent:
    radGroupBox1.BackColor = Color.Transparent;

    However, there is an issue, with the design-time display - it is not refreshed correctly to show you the real backcolor. I have added this issue into our Public Issue Tracking System. Please follow this link in order to subscribe to its status updates and also to add your vote for it.

    I have added 500 Telerik points to your account for this report. 

    Should you have any other questions or suggestions, do not hesitate to contact us.
     
    Greetings,
    Stefan
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. dario
    dario avatar
    9 posts
    Member since:
    Dec 2008

    Posted 15 Jun 2011 Link to this post

    Thanks, but setting BackColor=Transparent works for RadGroupBox "rectangle area" but doesn't affect Header back color.
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 21 Jun 2011 Link to this post

    Hello Darek,

    Thank you for your reply.

    Changing the BackColor of the header element can be achieved by setting its FillPrimitive BackColor:
    radGroupBox1.GroupBoxElement.Header.Fill.BackColor = Color.Transparent;

    Please note, that the header element is laying over the border of the content area and if you want to move it, you can set its Margin:
    radGroupBox1.GroupBoxElement.Header.Margin = new Padding(0, 0, 0, 11);

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.
     
    All the best,
    Stefan
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Back to Top