Is there a way to revert the cell value back to its original value while you are in the CellValueChanged event? I'm running some validations which are telling the cell to revert back to its original value. Thanks
Hello Ehan,
There are different approaches to solve this task. My suggestion is to use for example ultraTree1_BeforeCellExitEditMode() event instead of
ultraTree1_CellValueChanged() event, because ultraTree1_CellValueChanged() event will fire after each letter, that you type in the cell.
If you are using ultraTree1_BeforeCellExitEditMode() event, you could validate your current value through property - e.Cell.EditorResolved.CurrentEditText, and if you decide to cancel your current value, you could set
private void ultraTree1_BeforeCellExitEditMode(object sender, Infragistics.Win.UltraWinTree.BeforeCellExitEditModeEventArgs e)
{
/// Here is your Valudation
e.ApplyChanges =false;
}
Let me know if you have any questions.
Regards
Thanks for the info. This did not fix my problem but it gave me an idea that I think is working right now. My problem is that I'm dealing with a checkbox, which needs action every time the user changes its checked state. So, on the CellValueChanged event I'm setting the ActiveCell to null and then I'm using the AfterCellExitEditMode to revert back the value (BeforeCellActivate does not work for me because the new value has not yet been applied)
Hello ehan
If you need any additional assistance don’t hesitate to ask.
If the user presses Esc, it will do this.
You can achieve the same thing in code like so:
grid.PerformAction(UltraGridAction.UndoCell);