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

Underline text in combo edit box

5 Answers 265 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Brian Scott
Top achievements
Rank 1
Brian Scott asked on 15 Nov 2010, 06:17 PM
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?

5 Answers, 1 is accepted

Sort by
0
Brian Scott
Top achievements
Rank 1
answered on 16 Nov 2010, 06:48 PM
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? ;)
0
Konstantina
Telerik team
answered on 17 Nov 2010, 11:30 AM
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>>
0
Brian Scott
Top achievements
Rank 1
answered on 17 Nov 2010, 11:50 AM
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?
0
Accepted
Konstantina
Telerik team
answered on 18 Nov 2010, 09:26 AM
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
0
Brian Scott
Top achievements
Rank 1
answered on 15 Dec 2010, 12:22 PM
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
Tags
ComboBox
Asked by
Brian Scott
Top achievements
Rank 1
Answers by
Brian Scott
Top achievements
Rank 1
Konstantina
Telerik team
Share this question
or