Skip to content

Commit dbafe11

Browse files
"ServerWASM with Global and None"
1 parent db7186b commit dbafe11

File tree

5 files changed

+43
-15
lines changed

5 files changed

+43
-15
lines changed
Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
@page "/"
22

3+
@using Syncfusion.Blazor.Grids
4+
35
<PageTitle>Home</PageTitle>
46

5-
<h1>Hello, world!</h1>
7+
<SfGrid DataSource="@Orders" AllowPaging="true" AllowSorting="true" AllowFiltering="true" AllowGrouping="true" />
8+
9+
@code {
10+
public List<Order> Orders { get; set; }
11+
12+
protected override void OnInitialized()
13+
{
14+
Orders = Enumerable.Range(1, 50).Select(x => new Order()
15+
{
16+
OrderID = 0 + x,
17+
CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
18+
}).ToList();
19+
}
20+
21+
public class Order
22+
{
23+
public int? OrderID { get; set; }
24+
public string CustomerID { get; set; }
625

7-
Welcome to your new app.
26+
}
27+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
2+
using Syncfusion.Blazor;
23

34
var builder = WebAssemblyHostBuilder.CreateDefault(args);
45

6+
builder.Services.AddSyncfusionBlazor();
57
await builder.Build().RunAsync();
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

3-
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
<Nullable>enable</Nullable>
7-
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
8-
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
9-
<RootNamespace>ServerWASM with Global and None.Client</RootNamespace>
10-
<AssemblyName>$(AssemblyName.Replace(' ', '_'))</AssemblyName>
11-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
8+
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
9+
<RootNamespace>ServerWASM with Global and None.Client</RootNamespace>
10+
<AssemblyName>$(AssemblyName.Replace(' ', '_'))</AssemblyName>
11+
</PropertyGroup>
1212

13-
<ItemGroup>
14-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
15-
</ItemGroup>
13+
<ItemGroup>
14+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
15+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="23.2.4" />
16+
<PackageReference Include="Syncfusion.Blazor.Grid" Version="23.2.4" />
17+
</ItemGroup>
1618

1719
</Project>

ServerWASM with Global and None/ServerWASM with Global and None/Components/App.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
<base href="/" />
88
<link rel="stylesheet" href="bootstrap/bootstrap.min.css" />
99
<link rel="stylesheet" href="app.css" />
10-
<link rel="stylesheet" href="ServerWASM with Global and None.styles.css" />
10+
@* <link rel="stylesheet" href="ServerWASM with Global and None.styles.css" /> *@
1111
<link rel="icon" type="image/png" href="favicon.png" />
12+
<link rel="stylesheet" href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" />
1213
<HeadOutlet @rendermode="@InteractiveAuto" />
1314
</head>
1415

1516
<body>
1617
<Routes @rendermode="@InteractiveAuto" />
1718
<script src="_framework/blazor.web.js"></script>
19+
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js"></script>
1820
</body>
1921

2022
</html>

ServerWASM with Global and None/ServerWASM with Global and None/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using ServerWASM_with_Global_and_None.Client.Pages;
22
using ServerWASM_with_Global_and_None.Components;
3+
using Syncfusion.Blazor;
34

45
var builder = WebApplication.CreateBuilder(args);
56

@@ -8,6 +9,7 @@
89
.AddInteractiveServerComponents()
910
.AddInteractiveWebAssemblyComponents();
1011

12+
builder.Services.AddSyncfusionBlazor();
1113
var app = builder.Build();
1214

1315
// Configure the HTTP request pipeline.

0 commit comments

Comments
 (0)