@page "/"
@using Syncfusion.EJ2.RazorComponents.Grids
<EjsGrid id="Grid" DataSource="@gridData" Height="100%" AllowPaging="true" AllowSorting="true">
<GridPageSettings PageSize="5"></GridPageSettings>
<GridColumns>
<GridColumn Field="OrderID" HeaderText="Order ID" IsPrimaryKey="true" TextAlign="@TextAlign.Right" Width="120"></GridColumn>
...
</GridColumns>
</EjsGrid>
@functions {
public object gridData { get; set; }
protected override void OnInit()
{
gridData = OrdersDetails.GetAllRecordsone();
}
} |
...
namespace WebApplication1
{
public class OrdersDetails
{
...
public static object GetAllRecordsone()
{
var order = new[] {
new { OrderID = "10249", CustomerID = "ALFKI", OrderDate = new DateTime(1991, 02, 04), Freight = 11.22, ShipCountry = "Berlin" },
new { OrderID = "10250", CustomerID = "BOLID", OrderDate = new DateTime(1996, 02, 04), Freight = 33.22, ShipCountry = "News" },
new { OrderID = "10260", CustomerID = "NOMID", OrderDate = new DateTime(1990, 02, 04), Freight = 22.22, ShipCountry = "ASDA" }
}.ToList();
return order;
}
...
}
|
[styles and scripts]
<environment include="Development">
<link rel="stylesheet" rel='nofollow' href="css/bootstrap/bootstrap.min.css" />
</environment> |
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
. . . .
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
</PropertyGroup> |