Skip to content

Commit fe0fc8d

Browse files
SSR rendering
1 parent 32c108a commit fe0fc8d

File tree

5 files changed

+40
-10
lines changed

5 files changed

+40
-10
lines changed

SSR with Per Page 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 Per Page and None.styles.css" />
10+
@* <link rel="stylesheet" href="SSR with Per Page 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: 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+
}

SSR with Per Page and None/Components/_Imports.razor

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

SSR with Per Page 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_Per_Page_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: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
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 Per Page and None</RootNamespace>
8-
<AssemblyName>$(AssemblyName.Replace(' ', '_'))</AssemblyName>
9-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<RootNamespace>SSR with Per Page and None</RootNamespace>
8+
<AssemblyName>$(AssemblyName.Replace(' ', '_'))</AssemblyName>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="23.2.4" />
13+
<PackageReference Include="Syncfusion.Blazor.Grid" Version="23.2.4" />
14+
</ItemGroup>
1015

1116
</Project>

0 commit comments

Comments
 (0)