I have an UltraGrid where some columns have an EditorWithCombo. The value lists are fetched from an API, and may change in the meantime. So, after refreshing the list itself, I also refresh the columns' value lists. This takes place by first emptying it (this becomes important later*), then filling it with new values.
Now, the following problem occurs:
Expected result: row 2's cell value shouldn't change.
Actual result: row 2's cell value reverts to null, unless the user hits the escape key.
I imagine this is a race condition: I'm still refreshing the value list, DataValueToText (maybe?) gets called on row 2, but the value list temporarily doesn't contain the value.
*) If I disable the code that clears ValueListItems, they issue does not appear to occur.
So, given all that, what I'd like to do is temporarily mark the value list as busy. However, it doesn't have a pair of BeginUpdate()/EndUpdate() methods, for example. I've also tried setting _Column.CellActivation = Activation.NoEdit as I'm refreshing, but this doesn't seem to work as of 22.1.20221.66: it appears that, while the cell isn't user-editable, the underlying data source is still modified.
Some more details:
OnBeforeRowUpdate doesn't yet get called. So the change to row 2 doesn't get committed until I hit enter. However, to the user, it looks like the value is empty.
Hello and thank you for contacting Infragistics.
Please elaborate your requirements in the way you are modifying the combo while the end user is in edit mode. I can't think of any reason where you would want to replace the datasource of a control especially while the user is in edit mode. Based on my understanding the issues would resolve itself if the the API you call that updates the value list items is only called while the cells are not in edit mode.
Here is a common scenario where you would want to have dependent dropdowns, but never replacing the value lists.
https://ko.infragistics.com/community/product_platforms/winforms/b/winforms-blog/posts/creating-a-dropdown-list-in-a-grid-cell-whose-list-values-are-dependent-on-another-cell
Note, that we recommend filtering the list rather than updating the list. Let me know if you have any questions.