How to change checkbox color in GridSwitchColumn?

Hello, I'm having trouble when trying to change the checkbox color in the GridSwitchColumn. Could you please help me with this issue? Thank you.


5 Replies

SV Suja Venkatesan Syncfusion Team June 21, 2022 09:52 AM UTC

Hi Josh,


Regarding query “How to change checkbox color in GridSwitchColumn”


You can achieve your requirement by  overriding the GetSwitchOnColor and GetSwitchOffColor methods in a custom style class deriving from DataGridStyle and assigning it to the SfDataGrid.GridStyle property. Please refer the link below for our Knowledge Base article on changing the checkbox colour of a GridSwitchColumn.


KB link: https://www.syncfusion.com/kb/13450/how-to-customize-the-gridswitchcolumn-states-color-in-xamairn-forms-datagrid-sfdatagrid


Please let us know if you need any further assistance.


Regards,

Suja



JP Josh Phan June 21, 2022 02:58 PM UTC

Thanks for your help Suja. It works. I just found out another issue: if I manually check the checkbox, the tick color will be white. If I programmatically check the box, the tick color will be black. Do you have any solution for this? Thank you.



SV Suja Venkatesan Syncfusion Team June 22, 2022 12:20 PM UTC

Hi Josh,
We'd like to inform you that we were able to replicate the reported issue in UWP platform only SfDataGrid with version 20.1.0.60. We have included a fix for "Check Color is black in GridSwitchColumn" in the weekly nuget version of SfDataGrid 20.1.0.61. We have tested this issue with the most recent version (20.1.0.61), and it works perfectly. We have attached a sample with SfDataGrid recent version for your reference. Could you please update the SfDataGrid to recent version and confirm whether the reported scenario gets resolved or not? Please revert to us with more details with illustation image or video if you are facing the reported scenario in Android or iOS platform.
Regards,
Suja

Attachment: DataGridXamarin_(1)_f608852c.zip


JP Josh Phan June 24, 2022 04:51 PM UTC

Thanks for your help. It works.



SV Suja Venkatesan Syncfusion Team June 27, 2022 04:52 AM UTC

Hi Josh,


We are glad to know that the reported problem has been resolved at your end. Please let us know if you need any further assistance. We are happy to help you.


Regards,

Suja


Loader.
Up arrow icon