Hi
We have some code that performs an action as soon as the user ticks a field in a grid.
I'm forcing the update to happen as soon as the cell is ticked using:
And allowing the user to cancel the action with this code:
This very nearly works perfectly, the only glitch is that if the user chooses to cancel the update the checkbox is still un-checked. This is only a UI thing, the value in the underlying object is correctly unchanged and as soon as the the user moves cell/row the cell then flicks back to being checked again.
Is this expected behaviour? Is there anyway to force the cell to reload it's value from the datasource when the change is cancelled (without reloading the entire grid)?
Hi Tom,
Frankly, I'm not sure if this is a bug or not. The cancel operation is working correctly, but the display isn't updating. It might just be because the cell is still active and in edit mode.
If you want, I can ask Infragistics Developer Support to write this up for developer review, but even if this is a bug, I'm not sure it's something that could be fixed without a large potential for breakage. So the easiest thing might be for you to work around it. I found a pretty simple and easy workaround:
Private Sub LocalityDRLUltraGrid_BeforeCellUpdate(sender As Object, e As BeforeCellUpdateEventArgs) Handles LocalityDRLUltraGrid.BeforeCellUpdate Select Case e.Cell.Column.Key Case "Boolean 1" If e.NewValue = False Then e.Cancel = (MessageBox.Show("Marking a locality as non-current will automatically mark all associated GP practices as non-current. Do you wish to continue?", _ "Mark locality non-current", MessageBoxButtons.YesNo) = DialogResult.No) If (e.Cancel) Then e.Cell.EditorResolved.Value = True End If End If End Select End Sub
That looks good, thanks Mike. Am I right in saying that setting e.Cell.EditorResolved won't cause a write to the underlying object, i.e. is it just updating the UI presentation?