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

RadGroupBox BackColor from Form insead of RadPage

3 Answers 195 Views
GroupBox
This is a migrated thread and some comments may be shown as answers.
dario
Top achievements
Rank 1
dario asked on 04 Jun 2011, 06:32 PM
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.

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 09 Jun 2011, 08:58 AM
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.
0
dario
Top achievements
Rank 1
answered on 15 Jun 2011, 09:17 PM
Thanks, but setting BackColor=Transparent works for RadGroupBox "rectangle area" but doesn't affect Header back color.
0
Stefan
Telerik team
answered on 21 Jun 2011, 08:28 AM
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.
Tags
GroupBox
Asked by
dario
Top achievements
Rank 1
Answers by
Stefan
Telerik team
dario
Top achievements
Rank 1
Share this question
or