Home › Forums › WinForms controls › Xceed Grid for WinForms › How to set cell value to arbitrary value if validation fails
I am new to XCeed Grid for .NET
In the cell’s LeavingEdit and ValidationError events, how can you set the cell value to an arbitrary value if validation fails ?
Further, is it possible to set any arbitrary value by keeping the cell in edit mode, and also by ending the edit mode ?
Imported from legacy forums. Posted by Rajesh (had 1781 views)
You can cast the sender to the cell, and use it to set the value, whether you stay in edit mode or leave it.
Cell cell = ( Cell )sender;cell.Value = “value”;
You can also use the e.NewValue, if you leave the edit mode but want to change the value.
Imported from legacy forums. Posted by André (had 2910 views)