Cannot change ForeColor of SplitButton

Hello,

I've tried changing forecolor of the splitbutton but it's not changing and reverts back to black. I'm attaching a project. Please check.


Attachment: SplitButton_be1b7062.7z

5 Replies

EM Elakkiya Muthukumarasamy Syncfusion Team November 1, 2021 12:16 PM UTC

Hi shankul, 

Greetings from Syncfusion. 

We have checked your query and we can understand that you want to change the fore color of SplitButton control. You can customize appearance of the SplitButton using the ISplitButtonRenderer. Please refer the sample for the same. 


Output: 
 


Please try it with the above solution and let us know if you need any further assistance on this. 

Regards, 
Elakkiya  



SG shankul gupta November 2, 2021 06:50 AM UTC

Hello,


Thanks for replying and I've already gone through this documentation and I already know that I can write a custom renderer If I want to change the styling of the SplitButton. But the point is, I'm allowed to change the font, resize it, also I'm allowed to change the background color of the SplitButton. But just to change the ForeColor , I have to go all the way writing a custom render which seems very unnecessary and time consuming task for something as small as simply changing some color property.


Also, Writing a custom render could be helpful where you'll be applying same style to multiple controls which could be the case of theming an entire application. But I only want to alter one single SplitButton for which custom renderer is just an Overkill.


Can you please add it to Improvements or feature request that we can change the ForeColor of the SplitButton from the properties window. 



EM Elakkiya Muthukumarasamy Syncfusion Team November 2, 2021 02:05 PM UTC

Hi shankul, 
 
On the further analysis we can set the forecolor of SplitButton control without using custom rendering. We can achieve this by applying the theme to the SplitButton and using ThemeStyle.SplitButtonStyle property. Please refer the code example and sample for the same. 
 
Code example: 
//For focus state 
this.splitButton1.ThemeStyle.SplitButtonStyle.FocusedForeColor = Color.Red; 
 
//For normal state 
this.splitButton1.ThemeStyle.SplitButtonStyle.ForeColor = Color.Yellow; 
 
 
 
Output: 
 
 
 
 
 
Please try it with the above solution and let us know if you need any further assistance on this. 
 
Regards, 
Elakkiya 



SG shankul gupta November 11, 2021 08:58 AM UTC

Hello thanks for the reply but this is not working for me. I guess there could be an issue in the assembly (18.4.0.39) ​That I'm using. I didn't really wanted to update as it would force me to update all the packages to avoid any assembly mismatch. But I guess I have to do it.


I also tried toggeling CanOverrideStyle ​property in order to make ThemeStyle ​Work but it also didn't work.



EM Elakkiya Muthukumarasamy Syncfusion Team November 11, 2021 01:37 PM UTC

Hi shankul, 

Sorry for this inconvenience. 

We have checked your query and found that we can set the forecolor of SplitButton control in 18.4.0.39 version also. We have prepared the sample for the same. Please refer the sample link below, 


Output: 
 

Please try it with the above sample and confirm us our replication is same as yours. If not please modify the sample as issue reproduceable. It will be helpful to provide the prompt solution on this. 

Regards, 
Elakkiya 



Loader.
Up arrow icon