-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.razor
37 lines (33 loc) · 1.13 KB
/
Index.razor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@page "/"
@using Microsoft.EntityFrameworkCore
@using BindGridToLargeData.Models;
@using DevExpress.Data.Linq
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
@implements IDisposable
@rendermode InteractiveServer
<div>
<DxGrid Data="GridDataSource"
TextWrapEnabled="false"
VirtualScrollingEnabled="true"
FilterMenuButtonDisplayMode="GridFilterMenuButtonDisplayMode.Always"
CssClass="my-grid">
<Columns>
<DxGridDataColumn FieldName="ShipName" />
<DxGridDataColumn FieldName="ShipCity" />
<DxGridDataColumn FieldName="ShipCountry" />
<DxGridDataColumn FieldName="OrderDate" />
<DxGridDataColumn FieldName="ShippedDate" />
</Columns>
</DxGrid>
</div>
@code {
object GridDataSource { get; set; }
NorthwindContext Northwind { get; set; }
protected override void OnInitialized() {
Northwind = NorthwindContextFactory.CreateDbContext();
GridDataSource = new GridDevExtremeDataSource<Order>(Northwind.Orders);
}
public void Dispose() {
Northwind?.Dispose();
}
}