<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="traderDaytraderMaui.NewPage1"
NavigationPage.HasBackButton="False"
NavigationPage.HasNavigationBar="False"
xmlns:sfgrid="clr-namespace:Syncfusion.Maui.DataGrid;assembly=Syncfusion.Maui.DataGrid"
Background="#44ff00"
Title="MyTabbedPage">
<Grid RowDefinitions="40, *">
<Label Grid.Row = "0" Text="Hellow"></Label>
<StackLayout Grid.Row="1">
<sfgrid:SfDataGrid
AutoGenerateColumnsMode="None"
RowHeight="48"
HorizontalScrollBarVisibility="Always"
VerticalScrollBarVisibility="Always"
ColumnWidthMode="Fill">
<sfgrid:SfDataGrid.Columns>
<sfgrid:DataGridTextColumn MappingName="Wins" HeaderTextAlignment="Center" CellTextAlignment="Center"
HeaderText="W">
</sfgrid:DataGridTextColumn>
<sfgrid:DataGridTextColumn MappingName="Losses" HeaderTextAlignment="Center" CellTextAlignment="Center"
HeaderText="L">
</sfgrid:DataGridTextColumn>
</sfgrid:SfDataGrid.Columns>
</sfgrid:SfDataGrid>
</StackLayout>
</Grid>
</ContentPage>
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureSyncfusionCore()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("Font Awesome 6 Free-Solid-900.otf", "FASolid");
fonts.AddFont("Font Awesome 6 Free-Regular-400.otf", "FARegular");
fonts.AddFont("Font Awesome 6 Brands-Regular-400.otf", "FABrandsRegular");
});
#if DEBUG
builder.Logging.AddDebug();
#endif
return builder.Build();
}
This works well on Windows
But not work well on Mac.
When add the sfdatagrid, it is showing only black screen.
When remove the sfdatagrid, it showing the "Hellow"
see attached screenshot and sample codes.
Hello I tried the sample Grid app from your forum also but it works well in windows but when try to run same on mac it gives blank screen. see attached codes and screenshot.
Hi
Umesh,
The blank issue you are facing on Mac is related to the theme. From the
screenshot provided, we identified that you are running the app on Mac with a
dark theme. Therefore, the necessary changes need to be added in the App.xaml
file. We have shared the code snippet, user guide link, and screenshot for your
reference.
Code Snippet:
In App.Xaml,
|
<?xml version = "1.0" encoding = "UTF-8" ?> <Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:SfDataGridSample" xmlns:syncTheme="clr-namespace:Syncfusion.Maui.Themes;assembly=Syncfusion.Maui.Core" x:Class="SfDataGridSample.App" UserAppTheme="Dark"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <syncTheme:SyncfusionThemeResourceDictionary VisualTheme="MaterialDark" /> <ResourceDictionary Source="Resources/Styles/Colors.xaml" /> <ResourceDictionary Source="Resources/Styles/Styles.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application> |
Ug link : Applying themes in Maui Controls
Regards,
Sethupathy D.
Thank you for the feedback.
Hi Umesh
Thanks for the update. We'll wait to hear from you. Please test on your end, and let us know if you need any further assistance. We're happy to help.
Regards,
Abinesh P