<TelerikComboBox TItem="ObjectSelection" TValue="int?" Data="_testObjs" Value="_objSel"
ValueExpression="() => _objSel" ValueChanged="ObjSelected"
TextField="@nameof(ObjectSelection.Description)"
ValueField="@nameof(ObjectSelection.Id)"
ScrollMode="DropDownScrollMode.Virtual" PopupHeight="200px" ItemHeight="20"
PageSize="20" ValueMapper="ValueMapper" OnRead="RetrieveObjs" TotalCount="100"></TelerikComboBox>
private IEnumerable<ObjectSelection> _testObjs;
private int? _objSel;
private Task ObjSelected(int? id)
{
return(Task.Run(() => _objSel = id));
}
public Task RetrieveObjs(ReadEventArgs args)
{
_testObjs = new[]
{
new ObjectSelection {Id = 1, Description = "Obj 1"},
new ObjectSelection {Id = 2, Description = "Obj 2"},
new ObjectSelection {Id = 3, Description = "Obj 3"},
};
return(Task.Delay(300));
}
In this scenario, when selecting an object in the combobox, the combobox remains emtpy.
If the value changed handler looks like below, the combobox behaves as expected:
private void ObjSelected(int? id)
{
_objSel = id;
}
When trying your REPL page it's quite obvious that there's a problem.
When repeatedly selecting items the combobox sometimes doesn't show the correct item.
See this video;
Video
Hi Robert,
The answer by my colleague Joana provides more details on the scenario. Can you try the suggestion and inform us about the result?