30 lines
1.2 KiB
Plaintext
30 lines
1.2 KiB
Plaintext
@page "/dev/tiamgridexample"
|
|
|
|
@using TIAMWebApp.Shared.Application.Interfaces;
|
|
@using TIAMWebApp.Shared.Application.Models;
|
|
@inject IWeatherForecastService WeatherForecastService;
|
|
|
|
<TiamGrid Data="Forecasts" Settings="InputAttributes">
|
|
<DxGridCommandColumn Width="150px" />
|
|
<DxGridDataColumn FieldName="@nameof(WeatherForecast.Date)"></DxGridDataColumn>
|
|
<DxGridDataColumn FieldName="@nameof(WeatherForecast.TemperatureC)"></DxGridDataColumn>
|
|
<DxGridDataColumn FieldName="@nameof(WeatherForecast.TemperatureF)"></DxGridDataColumn>
|
|
<DxGridDataColumn FieldName="@nameof(WeatherForecast.Summary)"></DxGridDataColumn>
|
|
</TiamGrid>
|
|
|
|
@code {
|
|
|
|
public List<WeatherForecast>? Forecasts { get; set; }
|
|
public Dictionary<string, object> InputAttributes { get; set; } =
|
|
new Dictionary<string, object>() {
|
|
{ "PageSize", 5 },
|
|
{ "ShowFilterRow", false },
|
|
{ "PagerVisible" , false },
|
|
{ "ShowGroupPanel", true }
|
|
};
|
|
protected override async Task OnInitializedAsync() {
|
|
base.OnInitialized();
|
|
WeatherForecast[]? data = await WeatherForecastService.GetWeatherForecastAsync();
|
|
Forecasts = data.ToList();
|
|
}
|
|
} |