Dzień dobry,
napisałem program który wyświetla komponent o nazwie InformatorKontrahent.razor
za pomocą:
await DialogService.ShowAsync<InformatorKontrahent>
wszystko działa super, oprócz tego że po wyświetleniu komponentu InformatorKontrahent
powinien wczytać dane o kontrahencie
za pomocą:
ListOfOrders = await baza.GetListOfOrders();
do komponentu MudDataGrid, ale niestety tego nie robi :(
Natomiast w konsoli za pomocą pętli foreach wszystko jest ok.
Oto najważniejsze elementy komponentu InformatorKontrahent
<MudDialogProvider />
<MudDialog IsVisible="Wyswietl" Style="width: 700px, height:700px" >
<TitleContent>
<MudDataGrid Items="@ListOfOrders">
<Columns>
<PropertyColumn Property="x => x.Kontrahent" Title="Kontahent" />
</Columns>
</MudDataGrid>
</TitleContent>
<DialogActions>
<MudButton Color="@Color" Variant="Variant.Filled" OnClick="PrzyciskAnuluj">OK</MudButton>
</DialogActions>
</MudDialog>
private async Task WczytajDane()
{
ListOfOrders = await baza.GetListOfOrders();
foreach (var a in ListOfOrders)
{
Console.WriteLine(a.Kontrahent);
}
StateHasChanged();
}
protected override async Task OnInitializedAsync()
{
await WczytajDane();
}