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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CurrentCellMoving cancel causes CurrentCellMoving event fired again

Thread ID:





62490 Jun 15,2007 05:37 PM UTC Jun 16,2007 01:47 AM UTC WinForms 2
Tags: GridControl
Alex Feldman
Asked On June 15, 2007 05:37 PM UTC


I am using GridControl. I just noticed while processing CurrentCellMoving event if I set GridCurrentCellMovingEventArgs.Cancel to true, the event is triggered again for the same current cell.

Should it be considered as an issue, or it works as designed?

Thank you,
Alex Feldman.

P.S. I attached slightly modified sample.


Alex Feldman
Replied On June 15, 2007 05:38 PM UTC

I forget to mention that I am using version against .NET 2.0 in VS 2005

Saravanan A [Syncfusion]
Replied On June 16, 2007 01:47 AM UTC

Hi Alex,

We could see this issue here. When we try to navigate between the cells it will fire the CurrentCellMoving event and if we set the e.Cancel to true, it will stop the moving and the CurrentCellMoving event will not raise again.
But if we try to navigate using mouse it will raise the CurrentCellMoving event to set the clicked cell as the CurrentCell. In this case if set the e.Cancel it will stop moving the CurrentCell, but it will still try to scroll the grid to make the clicked cell fully visible, while doing this it is raising the CurrentCellMoving event again with different e.Option argument (GridSetCurrentCellOptions.ScrollInView).
Now, you can avoid the execution of your code twice by adding some conditional logic using this argument.

Here is the modified code snippet of your CurrentCellMoving event handler.

void m_Grid_CurrentCellMoving(object sender, GridCurrentCellMovingEventArgs e)
GridCurrentCell cc = m_Grid.CurrentCell;
if (!(cc.MoveFromRowIndex == cc.MoveToRowIndex && cc.MoveFromColIndex == cc.MoveToColIndex))
if (e.Options == GridSetCurrentCellOptions.ScrollInView && !cc.MoveToDone)
e.Cancel = m_Closing;
if ((cc.RowIndex == m_ForcedRowIndex) && (cc.ColIndex == m_ForcedColIndex) && m_Grid.CurrentCell.HasCurrentCell)
OutputLine("Cell Moving!");
// write your code here to do the required task
e.Cancel = m_Closing;

Best Regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon