Skip to content

Commit 4e22708

Browse files
Added KB sample and image
1 parent 6e5b1f5 commit 4e22708

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1417
-2
lines changed

DataGridMAUI.sln

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31611.283
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataGridMAUI", "DataGridMAUI\DataGridMAUI.csproj", "{4D42EDAE-2B84-489A-8F4F-8DF28155C989}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{4D42EDAE-2B84-489A-8F4F-8DF28155C989}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{4D42EDAE-2B84-489A-8F4F-8DF28155C989}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{4D42EDAE-2B84-489A-8F4F-8DF28155C989}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{4D42EDAE-2B84-489A-8F4F-8DF28155C989}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{4D42EDAE-2B84-489A-8F4F-8DF28155C989}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{4D42EDAE-2B84-489A-8F4F-8DF28155C989}.Release|Any CPU.Deploy.0 = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(SolutionProperties) = preSolution
22+
HideSolutionNode = FALSE
23+
EndGlobalSection
24+
GlobalSection(ExtensibilityGlobals) = postSolution
25+
SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
26+
EndGlobalSection
27+
EndGlobal

DataGridMAUI/App.xaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version = "1.0" encoding = "UTF-8" ?>
2+
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:local="clr-namespace:DataGridMAUI"
5+
x:Class="DataGridMAUI.App">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
10+
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
11+
</ResourceDictionary.MergedDictionaries>
12+
</ResourceDictionary>
13+
</Application.Resources>
14+
</Application>

DataGridMAUI/App.xaml.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace DataGridMAUI;
2+
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
9+
MainPage = new AppShell();
10+
}
11+
}

DataGridMAUI/AppShell.xaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<Shell
3+
x:Class="DataGridMAUI.AppShell"
4+
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
6+
xmlns:local="clr-namespace:DataGridMAUI"
7+
Shell.FlyoutBehavior="Disabled">
8+
9+
<ShellContent
10+
Title="Home"
11+
ContentTemplate="{DataTemplate local:MainPage}"
12+
Route="MainPage" />
13+
14+
</Shell>

DataGridMAUI/AppShell.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace DataGridMAUI;
2+
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}

DataGridMAUI/DataGridMAUI.csproj

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
6+
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
7+
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>DataGridMAUI</RootNamespace>
10+
<UseMaui>true</UseMaui>
11+
<SingleProject>true</SingleProject>
12+
<ImplicitUsings>enable</ImplicitUsings>
13+
14+
<!-- Display name -->
15+
<ApplicationTitle>DataGridMAUI</ApplicationTitle>
16+
17+
<!-- App Identifier -->
18+
<ApplicationId>com.companyname.datagridmaui</ApplicationId>
19+
<ApplicationIdGuid>82a6bca5-3107-43cc-bc0a-f66fdd565d6a</ApplicationIdGuid>
20+
21+
<!-- Versions -->
22+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
23+
<ApplicationVersion>1</ApplicationVersion>
24+
25+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
26+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
27+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
28+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
29+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
30+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
31+
</PropertyGroup>
32+
33+
<ItemGroup>
34+
<!-- App Icon -->
35+
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
36+
37+
<!-- Splash Screen -->
38+
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
39+
40+
<!-- Images -->
41+
<MauiImage Include="Resources\Images\*" />
42+
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
43+
44+
<!-- Custom Fonts -->
45+
<MauiFont Include="Resources\Fonts\*" />
46+
47+
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
48+
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
49+
</ItemGroup>
50+
51+
<ItemGroup>
52+
<PackageReference Include="Syncfusion.Maui.DataGrid" Version="20.4.51" />
53+
</ItemGroup>
54+
55+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<IsFirstTimeProjectOpen>False</IsFirstTimeProjectOpen>
5+
<ActiveDebugFramework>net6.0-android</ActiveDebugFramework>
6+
<ActiveDebugProfile>Pixel 5 - API 31 (1) (Android 12.0 - API 31)</ActiveDebugProfile>
7+
<SelectedPlatformGroup>Emulator</SelectedPlatformGroup>
8+
<DefaultDevice>pixel_5_-_api_31_1</DefaultDevice>
9+
</PropertyGroup>
10+
</Project>

DataGridMAUI/MainPage.xaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.DataGrid;assembly=Syncfusion.Maui.DataGrid"
5+
xmlns:local="clr-namespace:DataGridMAUI"
6+
x:Class="DataGridMAUI.MainPage">
7+
8+
<ContentPage.BindingContext>
9+
<local:ViewModel x:Name="viewModel"/>
10+
</ContentPage.BindingContext>
11+
<syncfusion:SfDataGrid x:Name="dataGrid"
12+
AutoGenerateColumnsMode="None"
13+
ColumnWidthMode="Fill"
14+
ItemsSource="{Binding OrdersInfo}"
15+
RowHeight="180">
16+
<syncfusion:SfDataGrid.Columns>
17+
<syncfusion:DataGridTemplateColumn HeaderText="Orders Information" MappingName="OrderID">
18+
<syncfusion:DataGridTemplateColumn.CellTemplate>
19+
<DataTemplate>
20+
<Grid>
21+
<Grid.ColumnDefinitions>
22+
<ColumnDefinition Width="100" />
23+
<ColumnDefinition Width="100" />
24+
<ColumnDefinition Width="100" />
25+
</Grid.ColumnDefinitions>
26+
<Grid.RowDefinitions>
27+
<RowDefinition Height="40" />
28+
<RowDefinition Height="40" />
29+
<RowDefinition Height="40" />
30+
<RowDefinition Height="40" />
31+
</Grid.RowDefinitions>
32+
<Label Grid.Row="0"
33+
Grid.Column="0"
34+
FontAttributes="Bold"
35+
HorizontalTextAlignment="Center"
36+
Text="Order ID"
37+
TextColor="Black"
38+
VerticalTextAlignment="Center" />
39+
<Label Grid.Row="0"
40+
Grid.Column="1"
41+
HorizontalTextAlignment="Center"
42+
Text=":"
43+
TextColor="Black"
44+
VerticalTextAlignment="Center" />
45+
<Label Grid.Row="0"
46+
Grid.Column="2"
47+
HorizontalTextAlignment="Center"
48+
Text="{Binding OrderID}"
49+
VerticalTextAlignment="Center" />
50+
<Label Grid.Row="1"
51+
Grid.Column="0"
52+
FontAttributes="Bold"
53+
HorizontalTextAlignment="Center"
54+
Text="Customer ID"
55+
TextColor="Black"
56+
VerticalTextAlignment="Center" />
57+
<Label Grid.Row="1"
58+
Grid.Column="1"
59+
HorizontalTextAlignment="Center"
60+
Text=":"
61+
TextColor="Black"
62+
VerticalTextAlignment="Center" />
63+
<Label Grid.Row="1"
64+
Grid.Column="2"
65+
HorizontalTextAlignment="Center"
66+
Text="{Binding CustomerID}"
67+
VerticalTextAlignment="Center" />
68+
<Label Grid.Row="2"
69+
Grid.Column="0"
70+
FontAttributes="Bold"
71+
HorizontalTextAlignment="Center"
72+
Text="Freight"
73+
TextColor="Black"
74+
VerticalTextAlignment="Center" />
75+
<Label Grid.Row="2"
76+
Grid.Column="1"
77+
HorizontalTextAlignment="Center"
78+
Text=":"
79+
TextColor="Black"
80+
VerticalTextAlignment="Center" />
81+
<Label Grid.Row="2"
82+
Grid.Column="2"
83+
HorizontalTextAlignment="Center"
84+
Text="{Binding Freight}"
85+
VerticalTextAlignment="Center" />
86+
<Label Grid.Row="3"
87+
Grid.Column="0"
88+
FontAttributes="Bold"
89+
HorizontalTextAlignment="Center"
90+
Text="Country"
91+
TextColor="Black"
92+
VerticalTextAlignment="Center" />
93+
<Label Grid.Row="3"
94+
Grid.Column="1"
95+
HorizontalTextAlignment="Center"
96+
Text=":"
97+
TextColor="Black"
98+
VerticalTextAlignment="Center" />
99+
<Label Grid.Row="3"
100+
Grid.Column="2"
101+
HorizontalTextAlignment="Center"
102+
Text="{Binding Country}"
103+
VerticalTextAlignment="Center" />
104+
</Grid>
105+
</DataTemplate>
106+
</syncfusion:DataGridTemplateColumn.CellTemplate>
107+
</syncfusion:DataGridTemplateColumn>
108+
</syncfusion:SfDataGrid.Columns>
109+
</syncfusion:SfDataGrid>
110+
111+
</ContentPage>

DataGridMAUI/MainPage.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace DataGridMAUI;
2+
3+
public partial class MainPage : ContentPage
4+
{
5+
public MainPage()
6+
{
7+
InitializeComponent();
8+
}
9+
}
10+

DataGridMAUI/MauiProgram.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Syncfusion.Maui.Core.Hosting;
2+
3+
namespace DataGridMAUI;
4+
5+
public static class MauiProgram
6+
{
7+
public static MauiApp CreateMauiApp()
8+
{
9+
var builder = MauiApp.CreateBuilder();
10+
builder
11+
.UseMauiApp<App>()
12+
.ConfigureSyncfusionCore()
13+
.ConfigureFonts(fonts =>
14+
{
15+
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
16+
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
17+
});
18+
19+
return builder.Build();
20+
}
21+
}

0 commit comments

Comments
 (0)