How to change disable style of the TextBox of RadDropDownList

5 posts, 0 answers
  1. Ke
    Ke avatar
    18 posts
    Member since:
    Feb 2016

    Posted 04 Mar Link to this post

    I need to change the background color of many Rad controls when they are disabled, RadDropDownList is one of them. I have searched up the forum but have not found a satisfactory answer. I am wondering if there is a built-in property that I can just set, so that each time RadDropDownList is disabled, its background color changes to black or gray, instead of the default disable-color. 

    I understand that there is a built-in property to set default disable paint to false, it is shown in the code below. But then, how can I set up a custom disable paint? 

    UseDefaultDisabledPaint = false;  

  2. Ke
    Ke avatar
    18 posts
    Member since:
    Feb 2016

    Posted 04 Mar Link to this post

    Never mind, figured out the answer. 
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 08 Mar Link to this post

    Hello Ke,

    Thank you for writing.

    I am glad that the problem you were facing is now resolved. Note that the RadDropDownList.DropDownStyle property determines if the text area at the top of the control can be edited or not. Hence, it controls whether a TextBox will be displayed or not. Then you can customize the back color.

    Should you have further questions I would be glad to help.
     
    Regards,
    Dess
    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
  5. Ke
    Ke avatar
    18 posts
    Member since:
    Feb 2016

    Posted 15 Mar in reply to Dess Link to this post

    Hi Dess, I have a form that contains raddropdownlist and radmaskedtextbox. I realized that the color of the text inside the radropdownlist's textbox is different than the text color in the radmaskedtextbox, even though I set them to be the same. May I know why this is happening? How do I set the text color so that all the text in different controls are the same? 
  6. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 17 Mar Link to this post

    Hello Ke,

    Thank you for writing back. 

    If the DropDownStyle property is set to RadDropDownStyle.DropDown the ForeColor is exactly the same as both controls (RadDropDownList and RadMaskedEditBox) host the MS TextBox. Please refer to the attached screenshot. As to the RadDropDownStyle.DropDownList setting, it is necessary to set the DropDownListElement.EditableElement.UseCompatibleTextRendering property to false.

    I hope this information helps. If you have any additional questions, please let me know.

     Regards,
    Dess
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WinForms is Visual Studio 2017 Ready