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

RadComboBox caret brush in Expression Dark theme

8 Answers 174 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Akram
Top achievements
Rank 1
Akram asked on 13 Sep 2013, 06:52 PM
Hi 
I downloaded the latest version of teleric wpf components
I am using Expression Dark theme, but the RadComboBox caret brush set to black which make difficult to user to see it, Please let me know if i can change the caret brush.
I can change the caret brush for TextBox, but i need to do the same for RadComboBox.

Thanks ,
Akram
 

8 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 18 Sep 2013, 09:41 AM
Hi Akram,

In order to modify the CaretBrush property of the input TextBox of the ComboBox you will need to edit the EditableTemplate of the ComboBox. I would suggest that you set the desired theme using Implicit Styles, after that you can easily reach and modify the EditableTemplate of the ComboBox. You will need to find the TextBox named PART_EditableTextBox and set the CaretBrush property to the required color. For your convenience we have prepared and attached here a sample project demonstrating the exact approach.

Hope this helps.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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 >>
0
Akram
Top achievements
Rank 1
answered on 18 Sep 2013, 03:16 PM
Thanks Kalin, 

that's was very helpful for me.

Regards,
Akram
0
Don
Top achievements
Rank 1
answered on 04 Dec 2013, 12:36 AM
I have the same issue with the insertion cursor / caret being black.  I'm using version 2012.3.1129 under .Net 3.5.  Will the implicit styles work with that version of the controls and the .Net framework?  I'm asking because I tried to adapt the example code to my project, but the "CaretBrush" attribute seems to be undefined in the version I'm using.
0
Kalin
Telerik team
answered on 04 Dec 2013, 12:27 PM
Hi Don,

Could you please confirm the version of the controls you are using as the 2012.3.1129 version doesn't support .Net 3.5?

I'm looking forward to your response.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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 >>
0
Don
Top achievements
Rank 1
answered on 04 Dec 2013, 06:56 PM
Kalin,

Sorry about the wrong version number.  I checked the DLLs and the reported product version is 2012.3.1108.35.

Edit: BTW - The source for version 2012.3.1129 still has the batch files for building in .Net 3.5.  Since that was the last version I could find in the currently available downloadable sources that has build files for .Net 3.5 I assumed that was the version I had.
0
Don
Top achievements
Rank 1
answered on 04 Dec 2013, 07:32 PM
Just so I know: What is the last downloadable source of the WPF controls that had official support for .Net 3.5?  I use a custom build to protect the Telerik DLLs and because we have customizations to another control.  Thanks.
0
Kalin
Telerik team
answered on 05 Dec 2013, 02:02 PM
Hello Don,

The latest version of RadControls that officially supports .Net 3.5 is Q2 2012 SP2. As for this particular case after research it appeared the CaretBrush property of the TextBox is available in the .Net versions 4.0 and above. However as a workaround you can set the Background of the TextBox to Black as the CaretBrush takes automatically the opposite color of the Background. So you could either extract the ControlTemplate and set the Background of the mentioned TextBox or I can suggest you another approach which sets the property in the code behind without using Implicit Styles.

If you have the following ComboBox:
<telerik:RadComboBox x:Name="Combo" ItemsSource="{Binding ComboItems}" IsEditable="True" />

You can set the property of the TextBox the following way:
var editableTextBox = (TextBox)this.Combo.Template.FindName("PART_EditableTextBox", this.Combo);
editableTextBox.Background = Brushes.Black;

Hope this will work for you.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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 >>
0
Don
Top achievements
Rank 1
answered on 05 Dec 2013, 06:54 PM
Kalin,

That worked perfectly. Thank you!

- Don
Tags
ComboBox
Asked by
Akram
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Akram
Top achievements
Rank 1
Don
Top achievements
Rank 1
Share this question
or