Rowvalidating event e.Cancel Hangs
I am using Rowvalidating event to validate and prevent user from moving out of the row unless the validation succeeds.
The code looks like below
if
(dgdTelephones.Rows.Count > 0 && e.RowIndex < dgdTelephones.Rows.Count - 1){
if (dgdTelephones.IsCellNullOrEmpty("TelephoneType") ||dgdTelephones.IsCellValueExists(
"TelephoneType") ||dgdTelephones.IsCellNullOrEmpty(
"TelephoneNumber")){
e.Cancel =
true;}
}
I have 2 gridviews on the screen. This is one of them and has this event. When I move from this grid to any other control no issues, but when i move to the other grid, the system hangs. The processor is 100% used. Any idea whats happening. If I use the cell validating event it works fine, but i need to use the row validating event only.
If I remove the e.Cancel then it works but doesnt stop the row from moving

