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

Change border color of GroupBox header back to default

2 Answers 119 Views
GroupBox
This is a migrated thread and some comments may be shown as answers.
Roberto Wenzel
Top achievements
Rank 2
Roberto Wenzel asked on 22 Feb 2011, 06:59 PM
Hello,
I hope that someone can help me with this little issue.
I would like to change the color of a GroupBox Header back to the applied theme's default color.

I prgrammatically changed the border color with the following code to red to show an invalid user input (a kind of validation).

DirectCast
(.rgrb_CountryOfOrigin.GroupBoxElement.Children(1).Children(1), BorderPrimitive).ForeColor = Color.Red 

When the input is corrected the color should change back to its default value. Actually I use the desert theme.
Is there a possibillity to get a default color value for the assigned theme for the chosen control (eg GroupBox)?
If not, where can I find the theme values like colors etc?
Any help is appreciated.
Cheers Roberto

2 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 22 Feb 2011, 09:55 PM
Hello Roberto,

You can reset any values in the Telerik Presentation Framework by calling the ResetValue method and passing the property that you want to reset. In this case.

DirectCast(Me.RadGroupBox1.GroupBoxElement.Children(1).Children(1), BorderPrimitive).ResetValue(LightVisualElement.ForeColorProperty, Telerik.WinControls.ValueResetFlags.Local)

Hope you find that helpful
Richard
0
Roberto Wenzel
Top achievements
Rank 2
answered on 23 Feb 2011, 08:18 AM
Cool!
Thank you Richard. That is what I need.
Roberto
Tags
GroupBox
Asked by
Roberto Wenzel
Top achievements
Rank 2
Answers by
Richard Slade
Top achievements
Rank 2
Roberto Wenzel
Top achievements
Rank 2
Share this question
or