Skip to content

Commit c6a0403

Browse files
Sample modified with Grid
1 parent a04de7b commit c6a0403

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed

Server with Per Page and Individual/Components/App.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
<base href="/" />
88
<link rel="stylesheet" href="bootstrap/bootstrap.min.css" />
99
<link rel="stylesheet" href="app.css" />
10-
<link rel="stylesheet" href="Server with Per Page and Individual.styles.css" />
10+
@* <link rel="stylesheet" href="Server with Per Page 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" />
13+
<script type="text/javascript" src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js"></script>
1214
<HeadOutlet />
1315
</head>
1416

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
@page "/"
2+
@rendermode InteractiveServer
3+
@using Syncfusion.Blazor.Grids
24

35
<PageTitle>Home</PageTitle>
46

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

7-
Welcome to your new app.
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; }
25+
26+
}
27+
}

Server with Per Page and Individual/Components/_Imports.razor

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99
@using Microsoft.JSInterop
1010
@using Server_with_Per_Page_and_Individual
1111
@using Server_with_Per_Page_and_Individual.Components
12+
@using Syncfusion.Blazor
13+
@using Syncfusion.Blazor.Grids

Server with Per Page and Individual/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
using Server_with_Per_Page_and_Individual.Components;
55
using Server_with_Per_Page_and_Individual.Components.Account;
66
using Server_with_Per_Page_and_Individual.Data;
7+
using Syncfusion.Blazor;
78

89
var builder = WebApplication.CreateBuilder(args);
910

1011
// Add services to the container.
1112
builder.Services.AddRazorComponents()
1213
.AddInteractiveServerComponents();
14+
builder.Services.AddSyncfusionBlazor();
1315

1416
builder.Services.AddCascadingAuthenticationState();
1517
builder.Services.AddScoped<IdentityUserAccessor>();

Server with Per Page and Individual/Server with Per Page and Individual.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
1515
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
1616
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0" />
17+
<PackageReference Include="Syncfusion.Blazor.Grid" Version="23.1.44" />
18+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="23.1.44" />
1719
</ItemGroup>
1820

1921
</Project>

0 commit comments

Comments
 (0)