-
Notifications
You must be signed in to change notification settings - Fork 1
/
Index.razor
32 lines (27 loc) · 1.09 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
@page "/"
@using DxBlazorApp.Data
@using DxBlazorApp.Components
@inject WeatherForecastService ForecastService
<MyGrid Data="Forecasts" Settings="InputAttributes">
<DxGridCommandColumn Width="150px" />
<DxGridDataColumn FieldName="@nameof(WeatherForecast.Date)" />
<DxGridDataColumn FieldName="@nameof(WeatherForecast.TemperatureC)" />
<DxGridDataColumn FieldName="@nameof(WeatherForecast.TemperatureF)" />
<DxGridDataColumn FieldName="@nameof(WeatherForecast.Summary)" />
</MyGrid>
@code {
public List<WeatherForecast> Forecasts { get; set; }
public Dictionary<string, object> InputAttributes { get; set; } =
new Dictionary<string, object>() {
{ "EditMode", GridEditMode.EditRow},
{ "PageSize", 5 },
{ "ShowFilterRow", false },
{ "PagerVisible" , false },
{ "ShowGroupPanel", true }
};
protected override async Task OnInitializedAsync() {
base.OnInitialized();
WeatherForecast[] data = await ForecastService.GetForecastAsync(DateTime.Now);
Forecasts = data.ToList();
}
}