Reputation: 156
When I show the MudBlazor table, it initially looks like this:
In the code, I'm preloading an empty row, so when I click in the bottom area below the line under "Outcome", it expands and looks like this:
How do I programmatically get the table into the state of the second image - showing the blank row?
I've tried using SetSelectedItem with a StateHasChanged(), but that didn't seem to expand that row. Does anyone have any ideas?
Upvotes: 0
Views: 120
Reputation: 156
Here's what I did to get it to work:
protected override void OnAfterRender(bool firstRender)
{
if (firstRender)
{
theRow = tblDesiredOutcome.Items.SingleOrDefault(i => i.Position == Id);
if (theRow is not null) tblDesiredOutcome.SetSelectedItem(theRow);
tblDesiredOutcome.SetEditingItem(theRow);
//SelectedRowClassFunc(item, 1);
StateHasChanged();
}
base.OnAfterRender(firstRender);
Upvotes: 0