radDropDownList Border Color

9 posts, 1 answers
  1. Sr
    Sr avatar
    5 posts
    Member since:
    Jul 2012

    Posted 10 Jul 2012 Link to this post

    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;
  2. Answer
    Ivan Petrov
    Admin
    Ivan Petrov avatar
    705 posts

    Posted 13 Jul 2012 Link to this post

    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;

    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 >>
  3. Sr
    Sr avatar
    5 posts
    Member since:
    Jul 2012

    Posted 13 Jul 2012 Link to this post

    It worked well. Thank you Ivan
  4. Denis Cilliers
    Denis Cilliers avatar
    62 posts
    Member since:
    Jan 2004

    Posted 17 Sep 2012 Link to this post

    In VB.Net pls how would you do this?
  5. Stefan
    Admin
    Stefan avatar
    2908 posts

    Posted 17 Sep 2012 Link to this post

    Here you are Denis: 
    DirectCast(radDDL.DropDownListElement.Children(2), BorderPrimitive).ForeColor = Color.Red

    You can also use our free online converter at the following link: http://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 >>
  6. MG
    MG avatar
    6 posts
    Member since:
    May 2013

    Posted 14 Nov 2013 Link to this post

    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
  7. Stefan
    Admin
    Stefan avatar
    2908 posts

    Posted 19 Nov 2013 Link to this post

    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 >>
  8. Ian
    Ian avatar
    20 posts
    Member since:
    Dec 2015

    Posted 15 Jan in reply to Ivan Petrov Link to this post

    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 ?

  9. Dimitar
    Admin
    Dimitar avatar
    2677 posts

    Posted 15 Jan Link to this post

    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 onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top