Skip to content

Commit 2e09657

Browse files
committed
Added the project into the repository.
1 parent 94066de commit 2e09657

File tree

7 files changed

+143
-2
lines changed

7 files changed

+143
-2
lines changed

NETCoreWPFDemo.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.28621.142
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NETCoreWPFDemo", "NETCoreWPFDemo\NETCoreWPFDemo.csproj", "{BB8D206D-6B16-4122-826E-12A90CA00FCB}"
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+
{BB8D206D-6B16-4122-826E-12A90CA00FCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{BB8D206D-6B16-4122-826E-12A90CA00FCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{BB8D206D-6B16-4122-826E-12A90CA00FCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{BB8D206D-6B16-4122-826E-12A90CA00FCB}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {6A4B65FF-1D7E-4769-8F61-9B5678AEEDBC}
24+
EndGlobalSection
25+
EndGlobal

NETCoreWPFDemo/App.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="NETCoreWPFDemo.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:NETCoreWPFDemo"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>

NETCoreWPFDemo/App.xaml.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace NETCoreWPFDemo
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}

NETCoreWPFDemo/MainWindow.xaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Window x:Class="NETCoreWPFDemo.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:NETCoreWPFDemo"
7+
mc:Ignorable="d"
8+
Title="MainWindow" Height="450" Width="600">
9+
<Grid Name="ROOT_Grid">
10+
11+
</Grid>
12+
</Window>

NETCoreWPFDemo/MainWindow.xaml.cs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
using System.Data;
16+
using Syncfusion.UI.Xaml.Grid;
17+
18+
namespace NETCoreWPFDemo
19+
{
20+
public partial class MainWindow : Window
21+
{
22+
public MainWindow()
23+
{
24+
InitializeComponent();
25+
SfDataGrid dataGrid = new SfDataGrid() { Height = 550, Width = 600, ColumnSizer = GridLengthUnitType.Star };
26+
dataGrid.ItemsSource = GetDataTable();
27+
this.ROOT_Grid.Children.Add(dataGrid);
28+
}
29+
30+
public DataTable GetDataTable()
31+
{
32+
DataTable employeeCollection = new DataTable();
33+
var dt = DateTime.Now;
34+
35+
employeeCollection.Columns.Add("EmployeeID", typeof(int));
36+
employeeCollection.Columns[0].ColumnName = "Employee ID";
37+
employeeCollection.Columns.Add("EmployeeName", typeof(string));
38+
employeeCollection.Columns["EmployeeName"].ColumnName = "Employee Name";
39+
employeeCollection.Columns.Add("CustomerID", typeof(string));
40+
employeeCollection.Columns["CustomerID"].ColumnName = "Customer ID";
41+
employeeCollection.Columns.Add("Country", typeof(string));
42+
employeeCollection.Columns.Add("Date", typeof(DateTime));
43+
44+
employeeCollection.Rows.Add(1001, "Belgim", "YHGTR", "US", new DateTime(dt.Year, dt.Month, dt.Day));
45+
employeeCollection.Rows.Add(1002, "Oliver", "LDON", "UK", new DateTime(dt.Year, dt.Month, dt.AddDays(-1).Day));
46+
employeeCollection.Rows.Add(1003, "Bernald", "ALFKI", "US", new DateTime(dt.Year, dt.Month, dt.AddDays(-5).Day));
47+
employeeCollection.Rows.Add(1004, "James", "YHGTR", "US", new DateTime(dt.Year, dt.Month, dt.AddDays(-1).Day));
48+
employeeCollection.Rows.Add(1005, "Beverton", "BERGS", "Europe", new DateTime(dt.Year, dt.Month, dt.Day));
49+
50+
return employeeCollection;
51+
}
52+
}
53+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFramework>netcoreapp3.0</TargetFramework>
6+
<UseWPF>true</UseWPF>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Syncfusion.SfGrid.WPF" Version="17.1.0.42" />
11+
</ItemGroup>
12+
13+
</Project>

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
1-
# .net-core-3.0-wpf-demo
2-
This repository contains the project that uses Syncfusion WPF DataGrid control to display simple information in a .NET Core 3.0 application.
1+
# Syncfusion WPF DataGrid control used in .NET Core 3.0 application
2+
3+
This repository contains the examples of usage of [Syncfusion WPF DataGrid control](https://www.syncfusion.com/wpf-ui-controls/datagrid) a .NET Core 3.0 application.
4+
5+
## Getting Started
6+
7+
* Checkout this project to a location in your disk.
8+
* Running the project should restore the required nuget packages and deploy the same.
9+
10+
### Prerequisites
11+
12+
The prerequisites for running a .NET Core Core project are:
13+
* Visual Studio 2019
14+
* .NET Core 3.0 SDK (Download Link)

0 commit comments

Comments
 (0)