I want to capture the user selection (which has to happen through ValueChanged, as OnChange does not fire when I need it). At this point I want to use the selection from the user and to clear the combo box.
I would expect that this should work but it does not:
@result
<br />
from model: @MyItem
<br />
<br />
<TelerikComboBox Data="@MyList" Value="@MyItem" ValueChanged="@( (string v) => MyValueChangeHandler(v) )" Placeholder="Choose something">
</TelerikComboBox>
@code {
string result;
private async Task MyValueChangeHandler(string theUserChoice)
{
result = string.Format("The user chose: {0}", theUserChoice);
MyItem = null; // this should be enough
}
protected List<string> MyList = new List<string>() { "first", "second", "third" };
protected string MyItem { get; set; } = "second";
}