Thank you for contacting us with this question.
You can change the back color of the RadButton at runtime using the following line of code:
|((FillPrimitive)radButton1.ButtonElement.GetChildrenByType(typeof(FillPrimitive))).BackColor = Color.Blue; |
Please keep in mind that by default, the RadButton's fill mode is gradient, so if you need to have a solid background, you also need to add this next line of code. Using the GradientStyle
property you can change the type of gradient (Gel, Glass, etc.)
|((FillPrimitive)radButton1.ButtonElement.GetChildrenByType(typeof(FillPrimitive))).GradientStyle = Telerik.WinControls.GradientStyles.Solid; |
You have to use the BackColor2, BackColor3 and BackColor4 properties for the colors to be used for the gradient of the FillPrimitive. You can also modify the number of colors in the gradient using the NumberOfColors property of the FillPrimitive.
Keep in mind, applying a BackColor like that will override any setting to the BackColor coming from a theme.
Thank you for taking the time to write again. Please let me know if you have any additional questions.
the Telerik team