Skip to content

Commit 8c92f5a

Browse files
SSR rendering
1 parent 88f2ffa commit 8c92f5a

File tree

4 files changed

+36
-11
lines changed

4 files changed

+36
-11
lines changed

SSR with Global and None/Components/App.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
<base href="/" />
88
<link rel="stylesheet" href="bootstrap/bootstrap.min.css" />
99
<link rel="stylesheet" href="app.css" />
10-
<link rel="stylesheet" href="SSR with Global and None.styles.css" />
10+
@* <link rel="stylesheet" href="SSR 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 />
1314
</head>
1415

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
@page "/"
2+
@using Syncfusion.Blazor.Grids
23

34
<PageTitle>Home</PageTitle>
45

5-
<h1>Hello, world!</h1>
6+
<SfGrid DataSource="@Orders" />
67

7-
Welcome to your new app.
8+
@code {
9+
public List<Order> Orders { get; set; }
10+
11+
protected override void OnInitialized()
12+
{
13+
Orders = Enumerable.Range(1, 10).Select(x => new Order()
14+
{
15+
OrderID = 0 + x,
16+
CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
17+
}).ToList();
18+
}
19+
20+
public class Order
21+
{
22+
public int? OrderID { get; set; }
23+
public string CustomerID { get; set; }
24+
25+
}
26+
}

SSR with Global and None/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
using SSR_with_Global_and_None.Components;
2+
using Syncfusion.Blazor;
23

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

56
// Add services to the container.
67
builder.Services.AddRazorComponents();
8+
builder.Services.AddSyncfusionBlazor();
79

810
var app = builder.Build();
911

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

3-
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<RootNamespace>SSR with Global and None</RootNamespace>
8-
<AssemblyName>$(AssemblyName.Replace(' ', '_'))</AssemblyName>
9-
</PropertyGroup>
10-
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<RootNamespace>SSR with Global and None</RootNamespace>
8+
<AssemblyName>$(AssemblyName.Replace(' ', '_'))</AssemblyName>
9+
</PropertyGroup>
10+
<ItemGroup>
11+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="23.2.4" />
12+
<PackageReference Include="Syncfusion.Blazor.Grid" Version="23.2.4" />
13+
</ItemGroup>
1114
</Project>

0 commit comments

Comments
 (0)