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

radDropDownList Border Color

8 Answers 700 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Sr
Top achievements
Rank 1
Sr asked on 10 Jul 2012, 08:35 PM
Hi,

I am unable to highlight the full dropdown list (including the text box and button) 

The attached file will show how it is currently highlight but would like to highlight in the same way(color and thickness) as the textbox in the attached file. I used the below code but it did not highlight the button.

Thanks in advance for your help.



radDDL.DropDownListElement.TextBox.Fill.BackColor = Color.Red;

8 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Petrov
Telerik team
answered on 13 Jul 2012, 12:46 PM | edited on 08 Aug 2024, 01:56 PM

Hello,

Thank you for writing.

You can change the border color of the whole drop-down list by using the following code line:

((BorderPrimitive)radDDL.DropDownListElement.Children[2]).ForeColor = Color.Red;
Edit: With Q3 2012 the hierarchy of DropDownListElement children has changed and the child index of the BorderPrimitive is 0:
((BorderPrimitive)radDDL.DropDownListElement.Children[0]).ForeColor = Color.Red;
Feel free to write back with any further questions.

Kind regards,
Ivan Petrov
the Telerik team

 

RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Sr
Top achievements
Rank 1
answered on 13 Jul 2012, 04:23 PM
It worked well. Thank you Ivan
0
Denis Cilliers
Top achievements
Rank 1
answered on 17 Sep 2012, 10:40 AM
In VB.Net pls how would you do this?
0
Stefan
Telerik team
answered on 17 Sep 2012, 11:10 AM | edited on 12 Aug 2024, 12:22 PM

Here you are Denis: 

CType(radDDL.DropDownListElement.Children(2), BorderPrimitive).ForeColor = Color.Red

Edit: With Q3 2012 the hierarchy of DropDownListElement children has changed and the child index of the BorderPrimitive is 0

CType(radDDL.DropDownListElement.Children(0), BorderPrimitive).ForeColor = Color.Red

You can also use our free online converter at the following link: https://converter.telerik.com/.

Regards,
Stefan
the Telerik team

RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
MG
Top achievements
Rank 1
answered on 14 Nov 2013, 10:30 AM
Hi,

I think it has to be 
((BorderPrimitive)radDDL.DropDownListElement.Children[0]).ForeColor = Color.Red;

rather than

((BorderPrimitive)radDDL.DropDownListElement.Children[2]).ForeColor = Color.Red;

I am using version: 2013.3.1016.40

Thx,
MG
0
Stefan
Telerik team
answered on 19 Nov 2013, 09:22 AM | edited on 12 Aug 2024, 12:24 PM
Hello MG,

Thank you for writing.

I can confirm that the BorderPrimitive is the first child in the collection in our latest version. The change was introduced back in Q3 2012 as stated in our Release Notes.

I hope this helps.

Regards,
Stefan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
answered on 15 Jan 2019, 11:33 AM

In vb.net, I could only make this work with:

  Dim bp As BorderPrimitive = TryCast(RadDropDownList1.DropDownListElement.Children.Item(0), BorderPrimitive)
        bp.ForeColor = Color.Red

- I found the border at position zero in the children collection.

Is the above answer out-of-date, or  am I doing something different ?

0
Dimitar
Telerik team
answered on 15 Jan 2019, 02:41 PM
Hi Ian,

I have tested this and it works on my side. Are you using a specific theme in this case? Please make sure that the color is not set at another place in the code.

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Get quickly and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
DropDownList
Asked by
Sr
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Sr
Top achievements
Rank 1
Denis Cilliers
Top achievements
Rank 1
Stefan
Telerik team
MG
Top achievements
Rank 1
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Dimitar
Telerik team
Share this question
or