Skip to content

Commit 688f3b7

Browse files
Sample "WASM with global & individual" modified with Grid
1 parent 39a9ca7 commit 688f3b7

File tree

6 files changed

+31
-3
lines changed

6 files changed

+31
-3
lines changed

WASM with Global and Individual/WASM with Global and Individual.Client/Pages/Home.razor

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
<PageTitle>Home</PageTitle>
44

5-
<h1>Hello, world!</h1>
5+
<SfGrid DataSource="@Orders" AllowPaging="true" AllowSorting="true" AllowFiltering="true" AllowGrouping="true" />
66

7-
Welcome to your new app.
7+
@code {
8+
public List<Order> Orders { get; set; }
9+
10+
protected override void OnInitialized()
11+
{
12+
Orders = Enumerable.Range(1, 50).Select(x => new Order()
13+
{
14+
OrderID = 0 + x,
15+
CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
16+
}).ToList();
17+
}
18+
19+
public class Order
20+
{
21+
public int? OrderID { get; set; }
22+
public string CustomerID { get; set; }
23+
24+
}
25+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
using Microsoft.AspNetCore.Components.Authorization;
22
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
33
using WASM_with_Global_and_Individual.Client;
4+
using Syncfusion.Blazor;
45

56
var builder = WebAssemblyHostBuilder.CreateDefault(args);
67

78
builder.Services.AddAuthorizationCore();
89
builder.Services.AddCascadingAuthenticationState();
910
builder.Services.AddSingleton<AuthenticationStateProvider, PersistentAuthenticationStateProvider>();
11+
builder.Services.AddSyncfusionBlazor();
1012

1113
await builder.Build().RunAsync();

WASM with Global and Individual/WASM with Global and Individual.Client/WASM with Global and Individual.Client.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
1515
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.0" />
16+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="23.2.4" />
17+
<PackageReference Include="Syncfusion.Blazor.Grid" Version="23.2.4" />
1618
</ItemGroup>
1719

1820
</Project>

WASM with Global and Individual/WASM with Global and Individual.Client/_Imports.razor

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
@using Microsoft.AspNetCore.Components.Web.Virtualization
99
@using Microsoft.JSInterop
1010
@using WASM_with_Global_and_Individual.Client
11+
@using Syncfusion.Blazor
12+
@using Syncfusion.Blazor.Grids

WASM with Global and Individual/WASM with Global and Individual/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="WASM with Global and Individual.styles.css" />
10+
@* <link rel="stylesheet" href="WASM with Global and Individual.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="@RenderModeForPage" />
1314
</head>
1415

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

2022
</html>

WASM with Global and Individual/WASM with Global and Individual/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Microsoft.AspNetCore.Components.Authorization;
22
using Microsoft.AspNetCore.Identity;
33
using Microsoft.EntityFrameworkCore;
4+
using Syncfusion.Blazor;
45
using WASM_with_Global_and_Individual.Client.Pages;
56
using WASM_with_Global_and_Individual.Components;
67
using WASM_with_Global_and_Individual.Components.Account;
@@ -12,6 +13,7 @@
1213
builder.Services.AddRazorComponents()
1314
.AddInteractiveWebAssemblyComponents();
1415

16+
builder.Services.AddSyncfusionBlazor();
1517
builder.Services.AddCascadingAuthenticationState();
1618
builder.Services.AddScoped<IdentityUserAccessor>();
1719
builder.Services.AddScoped<IdentityRedirectManager>();

0 commit comments

Comments
 (0)