-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathRtl.razor
More file actions
45 lines (38 loc) · 1.54 KB
/
Rtl.razor
File metadata and controls
45 lines (38 loc) · 1.54 KB
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
38
39
40
41
42
43
44
45
@page "/rtl"
@using Microsoft.JSInterop
@using Syncfusion.Blazor
@using Syncfusion.Blazor.Grids
<LocalizationRoute></LocalizationRoute>
<SfGrid DataSource="@Orders" AllowSorting="true" AllowPaging="true">
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</SfGrid>
@code{
[Inject]
IJSRuntime JsRuntime { get; set; }
public List<Order> Orders { get; set; }
protected override void OnInitialized()
{
Orders = Enumerable.Range(1, 75).Select(x => new Order()
{
OrderID = 1000 + x,
CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
Freight = 2.1 * x,
OrderDate = DateTime.Now.AddDays(-x),
}).ToList();
}
public class Order
{
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public double? Freight { get; set; }
}
protected override void OnAfterRender(bool firstRender)
{
this.JsRuntime.Sf().LoadLocaleData("locale.json").SetCulture("de-DE").SetCurrencyCode("EUR").EnableRtl(true);
}
}