We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

CurrentCellValidating and CurrentCellMoving

Hi, I''m wondering how I can get around a problem I am having with CurrentCellValidating. I am handing the CurrentCellValidating event myself and if the cell value is not between a certain range I set e.Cancel = true. If I set e.Cancel = true and use the enter key to leave the currentCell everything works fine. However if I use the arrow keys to leave the cell the CurrentCellMoving event gets raised. I could check flag in CurrentCellMoving but I would rather not do this. Any help would be appreciated. Thanks Nicola

3 Replies

AD Administrator Syncfusion Team May 19, 2004 01:18 PM UTC

CurrentCellMoving should be raised anytime you leave one cell to go to another. This includes moves caused by the enter key, or the arrow keys, or the mouse. So, you should see CurrentCellMoving when you press the enter key to leave the current cell. Normally, setting e.Cancel = true in CurrentCellValidating prevents the user from leaving the currentcell. Exactly what problem are you seeing?

NI Nicola May 19, 2004 01:26 PM UTC

The problem I''m seeing is that I''m seting e.Cancel=true in CurrentCellValidating and the CurrentCellMoving event is still being raised. I thought this wasn''t supposed to happen but maybe I''m misunderstanding something. -Nicola

AD Administrator Syncfusion Team May 19, 2004 02:49 PM UTC

These events should work like this. gridControl1_CurrentCellMoving is fired before gridControl1_CurrentCellValidating. And it is fired whether or not the cell value has changed. CurrentCellValidating is fired only if the current cell is modified.

Live Chat Icon For mobile
Up arrow icon