I am pretty new to MatBlazor. I am trying to fill a MatSelectItem with some options after something happens.
Initial locations = new LocnamesItem[] {};
<MatSelectItem Disabled="@(!locationvisible)" Label="Select Location" Value="@selectedLocation" Items="@locations" TValue="LocnamesItem">
<ItemTemplate>
<span>@context?.Locname - @context.Locdescr </span>
</ItemTemplate>
</MatSelectItem>
There is a login happening after which I fill the locations array with data.
locationList = await LoginProcess.GetLocations(login.sysUserId);
locations = locationList.ToArray();
StateHasChanged();
Unfortunately the options don't appear after statehaschanged call.
Regular select control with options building works well with similar code.
question from:
https://stackoverflow.com/questions/65621723/how-to-fill-matblazor-selectitem-after-an-event 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…