Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Cannot select a recently added item to MudTreeView

$
0
0

I'm trying to add an item to a MudTreeView control and inmediatley after select it.

The control has this property

@bind-SelectedValue="SelectedItem"

and in my code I have

    string SelectedItem;    private void Add(){        var value = $"P{InitialTreeItems.Count}";        var treeItem = new TreeItemData<string> { Value = value, Icon = Icons.Material.Filled.Group};        InitialTreeItems.Add(treeItem);        SelectedItem = value;    }

but the item is not selected.

Strangely, selecting later is possible.

You can test in here: https://try.mudblazor.com/snippet/mYGfFQbeYvwUnHpG

The "Add" button will add items, but they are not selected, while the "Select Trash" one is selecting the item.

Thanks in advace?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>