When using the OnRead event of the ComboBox there is no way to retrieve the selectedItem because the list of items that is populated is internal.
There are 2 workaround but they are not ideal:
- Saving the list of items returned by the OnRead event into a parallel list and then retrieve the selectedItem from it -> the problem is that there will be 2 identical lists in memory and, if scaled, might cause problems:
CachedSitesList = result.Items;
args.Data = result.Items;
args.Total = (int)result.TotalCount;
- Retrieving the selectedItem by calling the DB using the Id of the item -> the problem is that it's one more request to add to the DB and the performance is going to decrease if scaled, also it seems useless as the item is already present in memory.
We suggest adding a function to return the selectedItem to improve performance and scalability of the component.