OK/Cancel colors on DatePicker in DataForm

Good day,

I'm unable to change the OK/Cancel text colors in the DatePicker footer which is used on a DataForm.  I use a dark theme and tried to tweak the default colors as well as using a global style, but without success.  I see in the Android demo the text color is the same as for the day selector circle ... I did not try to change it.

Image_3420_1782292339592


3 Replies 1 reply marked as answer

VO Vishal Omprasad Syncfusion Team June 29, 2026 12:38 PM UTC

Hi Jan,

Based on the shared details, we have checked the reported scenario “unable to change the OK/Cancel button text color in SfDataForm DatePicker”.

As per the current implementation, the Syncfusion SfDataForm uses the .NET MAUI DatePicker control, which on Android, displays a native DatePicker dialog. The OK/Cancel button colors are controlled by Android theme attributes and are not affected by DataForm or XAML styling.

This is a known limitation in .NET MAUI (Android) where there is no direct API to style the DatePicker dialog buttons individually.

Framework issue link - https://github.com/dotnet/maui/issues/31739.

A workaround, you can override the theme colors as follows:

<resources>

  <color name="colorPrimary">#E94E1B</color>

  <color name="colorAccent">#E94E1B</color>

</resources>

This ensures the dialog (including OK/Cancel buttons) uses the desired color.

We have prepared a simple sample, demonstrating the above approach and have attached it below for your reference.

We hope that this helps you. Please let us know if you need further assistance.

Regards,
Vishal O.


Attachment: DataFormDemo_de6fda2a.zip

Marked as answer

JV Jan van Schalkwyk June 30, 2026 09:41 AM UTC

Thank you Vishal - overriding the Android theme colors solved the problem.



VO Vishal Omprasad Syncfusion Team July 1, 2026 09:19 AM UTC

Hi Jan,

Thank you for confirming. We are glad to hear that the suggested workaround resolved the issue. Please let us know if you need any further assistance. We are happy to help.

Regards,
Vishal.


Loader.
Up arrow icon