We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Override text selection color for SfComboBox, SfNumericTextBox and SfNumericUpDown

Hi, 

I´m actually overriding the text selection color for textbox controls in my app with the below line in my app resources

    <SolidColorBrush x:Key="TextSelectionHighlightColorThemeBrush" Color="Red"/>

But it doesn't have an effect in Syncfusion controls like SfComboBox, SfNumericTextBox, or SfNumericUpDown. I have noticed for example that I can override another colors in SfComboBox in a similar way:

<SolidColorBrush x:Key="ComboBoxSelectedPointerOverBackgroundThemeBrush" Color="Red" />
<SolidColorBrush x:Key="ComboBoxSelectedBackgroundThemeBrush" Color="Blue"/>
<SolidColorBrush x:Key="ComboBoxItemSelectedBackgroundThemeBrush" Color="Blue" />
<SolidColorBrush x:Key="ComboBoxItemSelectedPointerOverBackgroundThemeBrush" Color="Red" />

So, my question is How can I override the text selection color in Syncfusion controls?

Thank you.
    



8 Replies

CH Chelo August 29, 2014 12:04 AM UTC

UPDATE
I have overriden the selection color in SfNumericTextBox, SfNumericUpDown and other controls by setting SelectionHighlightColor property, but I still haven't done it in SfComboBox. Is there any way to change that color in this control?

Thank you.


VV Vignesh V Syncfusion Team August 29, 2014 06:33 AM UTC

Hi Chelo,

We have prepared a sample that tries to meet your requirement 'Overriding SelectionColor for SfComboBox'. In the sample we have overriden ThemeBrush in App.xaml.

Please find the sample in below link.

Please let us know if you need any further assistance on this.

Regards,
Vignesh V


CH Chelo August 29, 2014 05:47 PM UTC

Thank you for your answer,

I already did what you show me in the sample, but what I need to do is to set the selection color of the text in the SfComboBox, I mean when you set the combobox mode to editable, you can type on it and select the text, so I need to change that selection color.

I attached an image to explain it better.

Thank you!


Attachment: SfComboBox_bc7808d5.rar


VV Vignesh V Syncfusion Team August 30, 2014 06:14 AM UTC

Hi Chelo,

Sorry about the inconvenience caused.

We have modified the sample by editing SfComboBox style and added 'SelectionHighlightColor' property to its TextBox mode. Now, by overriding the 'TextSelectionHighlightColorThemeBrush' in App.xaml, will change Combobox text SelectionColor. Please find the modified sample in following link.


Please let us know if you need any further assistance on this.

Regards,
Vignesh V



CH Chelo September 1, 2014 08:13 PM UTC

The last sample worked for me. 

If it´s possible, I would like you add the 'SelectionHighlightColor' property to the TextBox in SfComboBox in a future release to make it easier to set that color without modifying the control template.

Thank you.


VV Vignesh V Syncfusion Team September 2, 2014 12:39 PM UTC

Hi Chelo,

We have logged bug report based on your requirement and fix will be available in our next release. We request you to visit our website periodically for updates regarding releases.

Please let us know if you have any queries.

Regards,
Vignesh V


CE Cezar January 5, 2021 04:59 PM UTC

Is there any simpler way of doing this?

I just need to change the SelectionHighlightColor of a SfNumericTextBox. Is not possible that I will need to add +200 lines of code only to make this.


SS Sridevi Sivakumar Syncfusion Team January 6, 2021 02:44 PM UTC

Hi Chelo,

We have analyzed your query and we would like to inform you that SfNumericTextBox control has "SelectionHighlightColor" property in the UWP platform, using this property we can customize the selection color. Please have a sample from the below link.

Sample link:
https://www.syncfusion.com/downloads/support/forum/161209/ze/NumericSample2145050865

Code snippet:
[XAML]:
 
       
        SelectionHighlightColor="Red" 
  Value="123.45"/>
 
 

Note : We are not currently providing WinRT support. Above solution provided for SfNumericTextBox – UWP.

L
et us know if you need any further assistance.

Regards,
Sridevi S.
 
 


Loader.
Live Chat Icon For mobile
Up arrow icon