Skip to content

Commit 7c280b0

Browse files
Merge pull request #1 from Backiaraj/gantt
Update the project from older version to latest version (using .NET 7 Framework)
2 parents 73b1a97 + 72b0ad5 commit 7c280b0

Some content is hidden

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

54 files changed

+715
-1553
lines changed

App.razor

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
8+
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
13+
<PackageReference Include="Syncfusion.Blazor.Gantt" Version="24.1.45" />
14+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="24.1.45" />
15+
</ItemGroup>
16+
17+
</Project>

Exporting.Client/Pages/Counter.razor

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
@page "/counter"
2+
@rendermode InteractiveAuto
3+
4+
@using Syncfusion.Blazor.Gantt
5+
6+
<SfGantt ID="GanttContainer" @ref="Gantt" AllowExcelExport="true" Toolbar="@(new List<string>() { "ExcelExport", "CsvExport" })" DataSource="@TaskCollection" Height="450px" Width="700px">
7+
<GanttTaskFields Id="TaskId" Name="TaskName" StartDate="StartDate" EndDate="EndDate" Duration="Duration" Progress="Progress" Dependency="Predecessor" ParentID="ParentId"></GanttTaskFields>
8+
<GanttEvents OnToolbarClick="ToolbarClickHandler" TValue="TaskData"></GanttEvents>
9+
</SfGantt>
10+
11+
@code {
12+
public SfGantt<TaskData> Gantt;
13+
private List<TaskData> TaskCollection { get; set; }
14+
public void ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args)
15+
{
16+
if (args.Item.Id == "GanttContainer_excelexport")
17+
{
18+
this.Gantt.ExportToExcelAsync();
19+
}
20+
else if (args.Item.Id == "GanttContainer_csvexport")
21+
{
22+
this.Gantt.ExportToCsvAsync();
23+
}
24+
}
25+
protected override void OnInitialized()
26+
{
27+
this.TaskCollection = GetTaskCollection();
28+
}
29+
30+
public class TaskData
31+
{
32+
public int TaskId { get; set; }
33+
public string TaskName { get; set; }
34+
public DateTime StartDate { get; set; }
35+
public DateTime? EndDate { get; set; }
36+
public string Duration { get; set; }
37+
public int Progress { get; set; }
38+
public string Predecessor { get; set; }
39+
public int? ParentId { get; set; }
40+
public int[] ResourceId { get; set; }
41+
}
42+
43+
public static List<TaskData> GetTaskCollection()
44+
{
45+
List<TaskData> Tasks = new List<TaskData>()
46+
{
47+
new TaskData() { TaskId = 1, TaskName = "Project initiation", StartDate = new DateTime(2022, 01, 04), EndDate = new DateTime(2022, 01, 17), },
48+
new TaskData() { TaskId = 2, TaskName = "Identify Site location", StartDate = new DateTime(2022, 01, 04), Duration = "0", Progress = 30, ParentId = 1, },
49+
new TaskData() { TaskId = 3, TaskName = "Perform soil test", StartDate = new DateTime(2022, 01, 04), Duration = "4", Progress = 40, ParentId = 1, Predecessor="2", },
50+
new TaskData() { TaskId = 4, TaskName = "Soil test approval", StartDate = new DateTime(2022, 01, 04), Duration = "0", Progress = 30, ParentId = 1, Predecessor="3", },
51+
new TaskData() { TaskId = 5, TaskName = "Project estimation", StartDate = new DateTime(2022, 01, 04), EndDate = new DateTime(2022, 01, 17), },
52+
new TaskData() { TaskId = 6, TaskName = "Develop floor plan for estimation", StartDate = new DateTime(2022, 01, 06), Duration = "3", Progress = 30, ParentId = 5, Predecessor="4", },
53+
new TaskData() { TaskId = 7, TaskName = "List materials", StartDate = new DateTime(2022, 01, 06), Duration = "3", Progress = 40, ParentId = 5, Predecessor="6", },
54+
new TaskData() { TaskId = 8, TaskName = "Estimation approval", StartDate = new DateTime(2022, 01, 06), Duration = "0", Progress = 30, ParentId = 5, Predecessor="7", }
55+
};
56+
return Tasks;
57+
}
58+
}

Exporting.Client/Program.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
2+
using Syncfusion.Blazor;
3+
4+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
5+
builder.Services.AddSyncfusionBlazor();
6+
await builder.Build().RunAsync();
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
@using System.Net.Http
2-
@using System.Net.Http.Json
3-
@using Microsoft.AspNetCore.Components.Forms
4-
@using Microsoft.AspNetCore.Components.Routing
5-
@using Microsoft.AspNetCore.Components.Web
6-
@using Microsoft.AspNetCore.Components.Web.Virtualization
7-
@using Microsoft.AspNetCore.Components.WebAssembly.Http
8-
@using Microsoft.JSInterop
9-
@using MyBlazorApp
10-
@using MyBlazorApp.Shared
11-
@using Syncfusion.Blazor
12-
@using Syncfusion.Blazor.Gantt
1+
@using System.Net.Http
2+
@using System.Net.Http.Json
3+
@using Microsoft.AspNetCore.Components.Forms
4+
@using Microsoft.AspNetCore.Components.Routing
5+
@using Microsoft.AspNetCore.Components.Web
6+
@using static Microsoft.AspNetCore.Components.Web.RenderMode
7+
@using Microsoft.AspNetCore.Components.Web.Virtualization
8+
@using Microsoft.JSInterop
9+
@using Exporting.Client
10+
@using Syncfusion.Blazor
11+
@using Syncfusion.Blazor.Gantt
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}

Exporting.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.8.34330.188
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exporting", "Exporting\Exporting.csproj", "{B496E7EE-A7AA-4532-A6B5-E6E9A926C2D0}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exporting.Client", "Exporting.Client\Exporting.Client.csproj", "{D0728CB2-CD60-43D1-BB0D-F908B6C6663B}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{B496E7EE-A7AA-4532-A6B5-E6E9A926C2D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{B496E7EE-A7AA-4532-A6B5-E6E9A926C2D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{B496E7EE-A7AA-4532-A6B5-E6E9A926C2D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{B496E7EE-A7AA-4532-A6B5-E6E9A926C2D0}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{D0728CB2-CD60-43D1-BB0D-F908B6C6663B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{D0728CB2-CD60-43D1-BB0D-F908B6C6663B}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{D0728CB2-CD60-43D1-BB0D-F908B6C6663B}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{D0728CB2-CD60-43D1-BB0D-F908B6C6663B}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {307FE7C1-3D34-43B5-BDED-77F1714191B6}
30+
EndGlobalSection
31+
EndGlobal

Exporting/Components/App.razor

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<base href="/" />
8+
<link rel="stylesheet" href="bootstrap/bootstrap.min.css" />
9+
<link rel="stylesheet" href="app.css" />
10+
<link rel="stylesheet" href="Exporting.styles.css" />
11+
<link rel="icon" type="image/png" href="favicon.png" />
12+
<link href="_content/Syncfusion.Blazor.Themes/material.css" rel="stylesheet" />
13+
<HeadOutlet />
14+
</head>
15+
16+
<body>
17+
<Routes />
18+
<script src="_framework/blazor.web.js"></script>
19+
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
20+
</body>
21+
22+
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@inherits LayoutComponentBase
2+
3+
<div class="page">
4+
<div class="sidebar">
5+
<NavMenu />
6+
</div>
7+
8+
<main>
9+
<div class="top-row px-4">
10+
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
11+
</div>
12+
13+
<article class="content px-4">
14+
@Body
15+
</article>
16+
</main>
17+
</div>
18+
19+
<div id="blazor-error-ui">
20+
An unhandled error has occurred.
21+
<a href="" class="reload">Reload</a>
22+
<a class="dismiss">🗙</a>
23+
</div>
Lines changed: 96 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,96 @@
1-
.page {
2-
position: relative;
3-
display: flex;
4-
flex-direction: column;
5-
}
6-
7-
.main {
8-
flex: 1;
9-
}
10-
11-
.sidebar {
12-
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
13-
}
14-
15-
.top-row {
16-
background-color: #f7f7f7;
17-
border-bottom: 1px solid #d6d5d5;
18-
justify-content: flex-end;
19-
height: 3.5rem;
20-
display: flex;
21-
align-items: center;
22-
}
23-
24-
.top-row ::deep a, .top-row .btn-link {
25-
white-space: nowrap;
26-
margin-left: 1.5rem;
27-
}
28-
29-
.top-row a:first-child {
30-
overflow: hidden;
31-
text-overflow: ellipsis;
32-
}
33-
34-
@media (max-width: 640.98px) {
35-
.top-row:not(.auth) {
36-
display: none;
37-
}
38-
39-
.top-row.auth {
40-
justify-content: space-between;
41-
}
42-
43-
.top-row a, .top-row .btn-link {
44-
margin-left: 0;
45-
}
46-
}
47-
48-
@media (min-width: 641px) {
49-
.page {
50-
flex-direction: row;
51-
}
52-
53-
.sidebar {
54-
width: 250px;
55-
height: 100vh;
56-
position: sticky;
57-
top: 0;
58-
}
59-
60-
.top-row {
61-
position: sticky;
62-
top: 0;
63-
z-index: 1;
64-
}
65-
66-
.main > div {
67-
padding-left: 2rem !important;
68-
padding-right: 1.5rem !important;
69-
}
70-
}
1+
.page {
2+
position: relative;
3+
display: flex;
4+
flex-direction: column;
5+
}
6+
7+
main {
8+
flex: 1;
9+
}
10+
11+
.sidebar {
12+
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
13+
}
14+
15+
.top-row {
16+
background-color: #f7f7f7;
17+
border-bottom: 1px solid #d6d5d5;
18+
justify-content: flex-end;
19+
height: 3.5rem;
20+
display: flex;
21+
align-items: center;
22+
}
23+
24+
.top-row ::deep a, .top-row ::deep .btn-link {
25+
white-space: nowrap;
26+
margin-left: 1.5rem;
27+
text-decoration: none;
28+
}
29+
30+
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31+
text-decoration: underline;
32+
}
33+
34+
.top-row ::deep a:first-child {
35+
overflow: hidden;
36+
text-overflow: ellipsis;
37+
}
38+
39+
@media (max-width: 640.98px) {
40+
.top-row {
41+
justify-content: space-between;
42+
}
43+
44+
.top-row ::deep a, .top-row ::deep .btn-link {
45+
margin-left: 0;
46+
}
47+
}
48+
49+
@media (min-width: 641px) {
50+
.page {
51+
flex-direction: row;
52+
}
53+
54+
.sidebar {
55+
width: 250px;
56+
height: 100vh;
57+
position: sticky;
58+
top: 0;
59+
}
60+
61+
.top-row {
62+
position: sticky;
63+
top: 0;
64+
z-index: 1;
65+
}
66+
67+
.top-row.auth ::deep a:first-child {
68+
flex: 1;
69+
text-align: right;
70+
width: 0;
71+
}
72+
73+
.top-row, article {
74+
padding-left: 2rem !important;
75+
padding-right: 1.5rem !important;
76+
}
77+
}
78+
79+
#blazor-error-ui {
80+
background: lightyellow;
81+
bottom: 0;
82+
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
83+
display: none;
84+
left: 0;
85+
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
86+
position: fixed;
87+
width: 100%;
88+
z-index: 1000;
89+
}
90+
91+
#blazor-error-ui .dismiss {
92+
cursor: pointer;
93+
position: absolute;
94+
right: 0.75rem;
95+
top: 0.5rem;
96+
}

0 commit comments

Comments
 (0)