Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions DataGridMAUI.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataGridMAUI", "DataGridMAUI\DataGridMAUI.csproj", "{4D42EDAE-2B84-489A-8F4F-8DF28155C989}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4D42EDAE-2B84-489A-8F4F-8DF28155C989}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D42EDAE-2B84-489A-8F4F-8DF28155C989}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D42EDAE-2B84-489A-8F4F-8DF28155C989}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{4D42EDAE-2B84-489A-8F4F-8DF28155C989}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D42EDAE-2B84-489A-8F4F-8DF28155C989}.Release|Any CPU.Build.0 = Release|Any CPU
{4D42EDAE-2B84-489A-8F4F-8DF28155C989}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
EndGlobalSection
EndGlobal
14 changes: 14 additions & 0 deletions DataGridMAUI/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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:DataGridMAUI"
x:Class="DataGridMAUI.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
11 changes: 11 additions & 0 deletions DataGridMAUI/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace DataGridMAUI;

public partial class App : Application
{
public App()
{
InitializeComponent();

MainPage = new AppShell();
}
}
14 changes: 14 additions & 0 deletions DataGridMAUI/AppShell.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="DataGridMAUI.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:DataGridMAUI"
Shell.FlyoutBehavior="Disabled">

<ShellContent
Title="Home"
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />

</Shell>
9 changes: 9 additions & 0 deletions DataGridMAUI/AppShell.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace DataGridMAUI;

public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
}
}
55 changes: 55 additions & 0 deletions DataGridMAUI/DataGridMAUI.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>DataGridMAUI</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

<!-- Display name -->
<ApplicationTitle>DataGridMAUI</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>com.companyname.datagridmaui</ApplicationId>
<ApplicationIdGuid>82a6bca5-3107-43cc-bc0a-f66fdd565d6a</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />

<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.Maui.DataGrid" Version="20.4.51" />
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions DataGridMAUI/DataGridMAUI.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IsFirstTimeProjectOpen>False</IsFirstTimeProjectOpen>
<ActiveDebugFramework>net6.0-android</ActiveDebugFramework>
<ActiveDebugProfile>Pixel 5 - API 31 (1) (Android 12.0 - API 31)</ActiveDebugProfile>
<SelectedPlatformGroup>Emulator</SelectedPlatformGroup>
<DefaultDevice>pixel_5_-_api_31_1</DefaultDevice>
</PropertyGroup>
</Project>
111 changes: 111 additions & 0 deletions DataGridMAUI/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?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"
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.DataGrid;assembly=Syncfusion.Maui.DataGrid"
xmlns:local="clr-namespace:DataGridMAUI"
x:Class="DataGridMAUI.MainPage">

<ContentPage.BindingContext>
<local:ViewModel x:Name="viewModel"/>
</ContentPage.BindingContext>
<syncfusion:SfDataGrid x:Name="dataGrid"
AutoGenerateColumnsMode="None"
ColumnWidthMode="Fill"
ItemsSource="{Binding OrdersInfo}"
RowHeight="180">
<syncfusion:SfDataGrid.Columns>
<syncfusion:DataGridTemplateColumn HeaderText="Orders Information" MappingName="OrderID">
<syncfusion:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<Label Grid.Row="0"
Grid.Column="0"
FontAttributes="Bold"
HorizontalTextAlignment="Center"
Text="Order ID"
TextColor="Black"
VerticalTextAlignment="Center" />
<Label Grid.Row="0"
Grid.Column="1"
HorizontalTextAlignment="Center"
Text=":"
TextColor="Black"
VerticalTextAlignment="Center" />
<Label Grid.Row="0"
Grid.Column="2"
HorizontalTextAlignment="Center"
Text="{Binding OrderID}"
VerticalTextAlignment="Center" />
<Label Grid.Row="1"
Grid.Column="0"
FontAttributes="Bold"
HorizontalTextAlignment="Center"
Text="Customer ID"
TextColor="Black"
VerticalTextAlignment="Center" />
<Label Grid.Row="1"
Grid.Column="1"
HorizontalTextAlignment="Center"
Text=":"
TextColor="Black"
VerticalTextAlignment="Center" />
<Label Grid.Row="1"
Grid.Column="2"
HorizontalTextAlignment="Center"
Text="{Binding CustomerID}"
VerticalTextAlignment="Center" />
<Label Grid.Row="2"
Grid.Column="0"
FontAttributes="Bold"
HorizontalTextAlignment="Center"
Text="Freight"
TextColor="Black"
VerticalTextAlignment="Center" />
<Label Grid.Row="2"
Grid.Column="1"
HorizontalTextAlignment="Center"
Text=":"
TextColor="Black"
VerticalTextAlignment="Center" />
<Label Grid.Row="2"
Grid.Column="2"
HorizontalTextAlignment="Center"
Text="{Binding Freight}"
VerticalTextAlignment="Center" />
<Label Grid.Row="3"
Grid.Column="0"
FontAttributes="Bold"
HorizontalTextAlignment="Center"
Text="Country"
TextColor="Black"
VerticalTextAlignment="Center" />
<Label Grid.Row="3"
Grid.Column="1"
HorizontalTextAlignment="Center"
Text=":"
TextColor="Black"
VerticalTextAlignment="Center" />
<Label Grid.Row="3"
Grid.Column="2"
HorizontalTextAlignment="Center"
Text="{Binding Country}"
VerticalTextAlignment="Center" />
</Grid>
</DataTemplate>
</syncfusion:DataGridTemplateColumn.CellTemplate>
</syncfusion:DataGridTemplateColumn>
</syncfusion:SfDataGrid.Columns>
</syncfusion:SfDataGrid>

</ContentPage>
10 changes: 10 additions & 0 deletions DataGridMAUI/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace DataGridMAUI;

public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
}

21 changes: 21 additions & 0 deletions DataGridMAUI/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Syncfusion.Maui.Core.Hosting;

namespace DataGridMAUI;

public static class MauiProgram
{
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");
});

return builder.Build();
}
}
64 changes: 64 additions & 0 deletions DataGridMAUI/Model/OrderInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;

namespace DataGridMAUI
{
public class OrderInfo : INotifyPropertyChanged
{
private int orderID;
private string customerID;
private string freight;
private string country;

public int OrderID
{
get { return orderID; }
set
{
orderID = value;
RaisePropertyChanged(nameof(orderID));
}
}
public string CustomerID
{
get { return customerID; }
set
{
customerID = value;
RaisePropertyChanged(nameof(customerID));
}
}

public string Freight
{
get { return freight; }
set
{
freight = value;
RaisePropertyChanged(nameof(freight));
}
}

public string Country
{
get { return country; }
set
{
country = value;
RaisePropertyChanged(nameof(country));
}
}

public event PropertyChangedEventHandler PropertyChanged;
private void RaisePropertyChanged(string propertyName)
{
if(this.PropertyChanged!=null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
Loading