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

Context menu font size with MahApps.Metro styled application

Hi,

My application is built using the Microsoft 'Template Studio for WPF' C# project template, which builds a shell application using MahApps.Metro.

The sfSpreadsheet context menu renders like this:

sfspreadsheet-context-menu.png


I'm a bit of a WPF newbie, but am struggling to work out how to address this issue.  Any pointers / solutions would be gratefully received.

Thank you.

Pete



8 Replies 1 reply marked as answer

PE Peter November 16, 2022 10:31 AM UTC

OP here.  I just noticed that in MahApp.Metro dark mode, it gets even worse!


sfspreadsheet-context-menu-2.png


Help!



SJ Sathiyathanam Jeyakumar Syncfusion Team November 16, 2022 03:03 PM UTC

SfSpreadSheet provides support for various built-in dark themes. It is not possible to apply other themes in SfSpreadSheet. You can refer the below help documentation to get more details about themes.  


UG reference https://help.syncfusion.com/wpf/spreadsheet/themes


Let us know if you need any further assistance on this.



PE Peter replied to Sathiyathanam Jeyakumar November 16, 2022 04:25 PM UTC

Thank you  Sathiyathanam Jeyakumar.  So, basically using the control in MahApps.Metro is not possible (because the rendering on the context menu in my first post cannot be overcome)?

Is this true also for other controls, such as your DataGrid?



DM Dhanasekar Mohanraj Syncfusion Team November 17, 2022 03:20 PM UTC

Yes, the statement mentioned is applicable to our SfDataGrid too. As we mentioned earlier, you can use the built-in themes for SfSpreadSheet. Except for the forms and popups, the built-in themes work properly for all elements that are present in the SfSpreadSheet. And revert to us if you are facing any issues with that.



PE Peter November 18, 2022 09:42 AM UTC

Hi  Dhanasekar Mohanraj, and thanks for your reply.

If I understand you correctly, if I need to use MahApps.Metro then the Syncfusion controls are just not going to render correctly in some areas (i.e. context menus and popups).  That is, truly, a shame!  Many thanks for your replies.



DM Dhanasekar Mohanraj Syncfusion Team November 21, 2022 04:21 PM UTC

Peter,

Using MahApps.Metro theme in Syncfusion controls is not supported. The elements and style names used in the Syncfusion controls would be different from the styles and templates of MahApps.Metro themes. So, other than styles of MS Controls, styles of most Syncfusion's own elements would not support the MahApps.Metro themes.


As we have updated earlier, Syncfusion controls support many built-in theme variants. Within the built-in support, theme support is not available for elements mentioned in SfSpreadsheet and PivotGridControl. We will continue and update the pending theme support on mentioned elements in any of our upcoming releases.



PE Peter November 21, 2022 06:41 PM UTC

Yes, thank you, Dhanasekar Mohanraj, for your confirmation and clarification.  I am resolved now!  This approach works perfectly with MahApps.Metro:

  1. Nuget install SfSkinManager.Wpf, Themes.MaterialDark.Wpf and Themes.MaterialLight.wpf.
  2. In my code, where 'griddie' is the sfDataGrid (or, presumably, sfSpreadsheet):

                    // Set the grid theme

                    if (App.Current.Properties["Theme"].ToString() == AppTheme.Light.ToString())

                        SfSkinManager.SetTheme(griddie, new Syncfusion.SfSkinManager.Theme("MaterialLight"));

                    else

                        SfSkinManager.SetTheme(griddie, new Syncfusion.SfSkinManager.Theme("MaterialDark"));

I hope this helps anyone visiting in the future, as it has taken me a while, albeit as a 'newbie' to solve


Marked as answer

DM Dhanasekar Mohanraj Syncfusion Team November 22, 2022 02:46 PM UTC

Peter,

We are glad that the reported issue was resolved on your side. If you are satisfied with our response, please mark it as an answer. Otherwise, please let us know if you have any further queries on this.


Loader.
Live Chat Icon For mobile
Up arrow icon