How to set select/focus borderline in the RadDropDownList

2 posts, 0 answers
  1. Tamil
    Tamil avatar
    1 posts
    Member since:
    Oct 2020

    Posted 14 Oct 2020 Link to this post

    Hello team,

    How to set select/focus borderline in the RadDropDownList?

    for example,
     if I press the tab button to focus on the RadButton that I can know the button is focused, but there is no focus borderline in the RadDropDownList. I have attached the image.

    Kindly, check and share the fix details for set the focus borderline in RadDropDownList. 

    Notes: I'm using C# code.

    Thanks.

  2. Nadya
    Admin
    Nadya avatar
    486 posts

    Posted 14 Oct 2020 Link to this post

    Hello, Tamil,

    Note that the look of RadControls is defined through the themes and it may differ from the look of the standard MS controls. Different themes offer different style settings. According to the attached picture with RadDropDownList, it seems that you are using the ControlDefault theme. However, it is important to know which is the specific theme that you use in order to apply proper styling. If you are using any custom theme it would be greatly appreciated if you can specify it.

    It is possible to change the style for a specific element state without losing the applied style for the rest of the states by overriding theme settings at run time. For example, when using the ControlDefault theme you can override the "ContainsFocus" state of the drop-down list and change the ForeColor property of the BorderPrimitive as demonstrated below:

    this.radDropDownList1.DropDownListElement.SetThemeValueOverride(BorderPrimitive.ForeColorProperty, Color.Orange, "ContainsFocus", typeof(BorderPrimitive));
    

    More information is available here: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/override-theme-settings-at-run-time 

    Another possible approach is to modify the theme directly with the Visual Style Builder tool and achieve the desired look.

    I hope this helps. Should you have other questions please let me know.

    Regards,
    Nadya
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Back to Top