Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
585
Prevent edit while value list is being updated
posted

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:

  1. the customer enables cell editing
  2. in row 1, they change an EditorWithCombo cell to a new value
  3. as the grid is refreshing, they click on an EditorWithCombo in row 2 (or any different line)

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.