Underline text in combo edit box

6 posts, 1 answers
  1. Brian Scott
    Brian Scott avatar
    11 posts
    Member since:
    Dec 2009

    Posted 15 Nov 2010 Link to this post

    Is there any way that I can display underline text in the edit box of the RadComboBox control? If I wanted to do this for a standard WPF text box then I would just set the TextDecorations property to 'Underline', however this property does not seem to be available for the RadComboBox control. My instance of the combo box is editable (i.e. IsEditable="True") so I can't set a selection box template. I looked at the EditableTemplate property, however using this seemed to lose all of the standard combo box functionality (e.g. drop down button, auto-selection, etc.). Any ideas?
  2. Brian Scott
    Brian Scott avatar
    11 posts
    Member since:
    Dec 2009

    Posted 16 Nov 2010 Link to this post

    OK, to answer my own post, the solution appears to be to create an attached property that extends the TextDecorations property to the RadComboBox control. I based my solution of the MaxLength example given in the online Telerik documentation for the RadComboBox, but have made the solution generic so that it can be used for any of the Rad WPF controls (well, I think so anyway!).

    One further question though. In my solution I used the "PART_EditableTextBox" element name to retrieve the text box from the RadComboBox control visual tree. However, what is the element name of the drop down button used by the control? Also, is this drop down button element name the same as that used by the date/time picker control?

    BTW do I get Telerik points by answering my own post? ;)
  3. UI for WPF is Visual Studio 2017 Ready
  4. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 17 Nov 2010 Link to this post

    Hi Brian,

    Thank you for sharing your solution.

    The name of the DropDownButton is "PART_DropDownButton". The buttons on the other controls may not be named with the same name.

    Please let us know if you need further information about our controls.

    Best wishes,
    Konstantina
    the Telerik team
    See What's New in RadControls for WPF in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
  5. Brian Scott
    Brian Scott avatar
    11 posts
    Member since:
    Dec 2009

    Posted 17 Nov 2010 Link to this post

    Thanks for that. As far as I can see, this is also the part name for the drop down button in the RadDateTimePicker control. However, the edit box part of that control is "PART_DateTimeInput" instead.

    I have tried a similar attached property approach to try and set the background colour of the drop down button of the RadComboBox control, however it doesn't appear to work. I can find the drop down button element, using the part name detailed above, however setting the background property doesn't appear to change the background colour of the drop down button. Is what I'm trying to achieve possible, and, if so, am I going about it the right or wrong way?
  6. Answer
    Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 18 Nov 2010 Link to this post

    Hi Brian,

    Unfortunately, changing the Background of that button cannot be achieved with this approach. The structure of the ComboBox is a bit more complicated. The DropDownButton itself is containing a ButtonChrome and an arrow Icon. Changing the Background of this DropDownButton have to made by setting a style for it. You can very easy achieve this with Expression Blend.

    Please let us know if you need more information.

    Kind regards,
    Konstantina
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for WPF
  7. Brian Scott
    Brian Scott avatar
    11 posts
    Member since:
    Dec 2009

    Posted 15 Dec 2010 Link to this post

    Thanks, that's solved it for me. Don't use expression blend, but managed to do the same thing via a style setter in the user control's resources.

    B
Back to Top
UI for WPF is Visual Studio 2017 Ready