The simplest way to do this is to let the RowLeave finish its Cancel work (as this point the focus back to the last editing cell), and then move the currentcell. If you do not, then the RowLeave will undo your call to CurrentCell.MoveTo. You can let RowLeave finish by using a Timer.
Timer t = null;
int targetCol = -1;
private void gridDataBoundGrid1_RowLeave(object sender, GridRowEventArgs e)
{
if(ThereIsAProblem())
{
MessageBox.Show( "Don''t leave");
e.Cancel = true;
if(t == null)
{
t = new Timer();
t.Interval = 30;
t.Tick += new EventHandler(t_Tick);
}
targetCol = 3;//where you want to go
t.Start();
}
}
private void t_Tick(object sender, EventArgs e)
{
t.Stop();
t.Tick -= new EventHandler(t_Tick);
t.Dispose();
t = null;
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
cc.MoveTo(cc.RowIndex, targetCol);
}