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

RadButton's Border does not show

1 Answer 475 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 03 Dec 2015, 09:56 AM

I have set the button's top border color to be red and bottom border color to be yellow by the below codes but the appearance never show the border colors when running.

            this.ButtonElement.BorderElement.BoxStyle = BorderBoxStyle.FourBorders;
            this.ButtonElement.BorderElement.TopColor = Color.Red;
            this.ButtonElement.BorderElement.TopWidth = 2;
            this.ButtonElement.BorderElement.BottomColor = Color.Yellow;
            this.ButtonElement.BorderElement.BottomWidth = 2;

Please help me to solve this problem.

1 Answer, 1 is accepted

Sort by
0
Ralitsa
Telerik team
answered on 03 Dec 2015, 02:49 PM
Hi Jason,

Thank you for contacting us.

You need to set the PaintUsingParentShape property to false. Please refer to the example below how to achieve it: 
this.radButton1.ButtonElement.BorderElement.PaintUsingParentShape = false;
this.radButton1.ButtonElement.ShowBorder = true;
this.radButton1.ButtonElement.BorderElement.BoxStyle = BorderBoxStyle.FourBorders;
this.radButton1.ButtonElement.BorderElement.TopColor = Color.Red;
this.radButton1.ButtonElement.BorderElement.TopWidth = 2;
this.radButton1.ButtonElement.BorderElement.BottomColor = Color.Yellow;
this.radButton1.ButtonElement.BorderElement.BottomWidth = 2;
this.radButton1.ButtonElement.BorderElement.LeftColor = Color.Blue;
this.radButton1.ButtonElement.BorderElement.LeftWidth = 3;
this.radButton1.ButtonElement.BorderElement.RightColor = Color.Green;
this.radButton1.ButtonElement.BorderElement.RightWidth = 3;

In the attachments you can find an image demonstrating the result on my end.

Should you have further questions, I would be glad to help. 

Regards,
Ralitsa
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Jason
Top achievements
Rank 1
Answers by
Ralitsa
Telerik team
Share this question
or