Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145570 | Jun 28,2019 08:55 AM UTC | Jul 1,2019 01:12 PM UTC | Blazor | 3 |
![]() |
Tags: Grid |
@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> |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.