AD
Administrator
Syncfusion Team
December 10, 2004 07:49 AM UTC
Here is an example of how this message might appear. The grid is in the process of moving the current cell (a ''MoveTo process''), and you try to call grid.CurrentCell.MoveTo to start a new MoveTo process of moving the currentcell from within an event like CurrentCellActivating that is part of the MoveTo process.
There are some events that you should not call CurrentCell.MoveTo (or CuurentCell.Activate or CurrentCell.Deactivate, etc.).
If you want to control where the Currentcell goes, you might try using the QueryNextCurrentCell event. Other things that might help in avoiding this problem is calling CurrentCell.Lock and Unloak around teh statement that is causing the error. You might also try handing CurrentCellMoved and do what you want there. By that time, the current cell moving process hav completed.
If you can post a sample project showing this error, maybe we can suggest some way fo doing what you want.
AP
Arun Prasath
December 13, 2004 06:14 AM UTC
hi,
I am using CurrentCellEditingComplete event to calculate some process.
Regards
Arun Prasath
AD
Administrator
Syncfusion Team
December 13, 2004 06:53 AM UTC
CurrentCellEditingComplete is part of the CurrentCell move process. So, from in that event you cannot do anything that might change the currentcell without first locking the current cell. Did you try that?
AD
Administrator
Syncfusion Team
August 8, 2005 12:14 PM UTC
I Also get the same exception, but i use moveto only in baritem.click event.
CP
Christian Pogea
August 8, 2005 12:24 PM UTC
this is one of the exceptions:
System.InvalidOperationException: Do not move current position with this method!
at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.SyncCurrentRecordState(Int32 pos)
at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.OnCurrentCellActivated(EventArgs e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.RaiseCurrentCellActivated()
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Activate(Int32 rowIndex, Int32 colIndex, GridSetCurrentCellOptions options)
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.MoveTo(Int32 rowIndex, Int32 colIndex, GridSetCurrentCellOptions options, Boolean discardChanges)
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.MoveTo(Int32 rowIndex, Int32 colIndex, GridSetCurrentCellOptions options)
at Syncfusion.Windows.Forms.Grid.GridSelectCellsMouseController.MouseDown(MouseEventArgs e)
at Syncfusion.Windows.Forms.MouseControllerDispatcher.ProcessMouseDown(MouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControllMouseControllerDispatcher.ScrollControlBeforeMouseDown(Object sender, CancelMouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControl.OnScrollControlMouseDown(CancelMouseEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.OnScrollControlMouseDown(CancelMouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControl.RaiseCancelMouseEvent(MouseEventArgs e, CancelMouseDelegate d)
catched at Syncfusion.Windows.Forms.ScrollControl.RaiseCancelMouseEvent(MouseEventArgs e, CancelMouseDelegate d) in :line 0
this is the other one:
System.InvalidOperationException: Do not move current position with this method!
at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.SyncCurrentRecordState(Int32 pos)
at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.OnCurrentCellActivated(EventArgs e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.RaiseCurrentCellActivated()
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Activate(Int32 rowIndex, Int32 colIndex, GridSetCurrentCellOptions options)
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.MoveTo(Int32 rowIndex, Int32 colIndex, GridSetCurrentCellOptions options, Boolean discardChanges)
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.InternalMove(GridDirectionType direction, Int32 num, GridSetCurrentCellOptions options)
at Syncfusion.Windows.Forms.Grid.GridSelectCellsMouseController.GridCurrentCellExternalMove(GridDirectionType direction, Int32 num, Boolean extendSelection)
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Move(GridDirectionType direction, Int32 num, Boolean extendSelection, Boolean wrapCell)
at Syncfusion.Windows.Forms.Grid.GridControlBase.OnKeyDown(KeyEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at Syncfusion.Windows.Forms.Grid.GridControlBase.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at Syncfusion.Windows.Forms.Grid.GridControlBase.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg)
at Syncfusion.Windows.Forms.Grid.GridControlBase.WndProc(Message& msg)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
AD
Administrator
Syncfusion Team
August 8, 2005 12:33 PM UTC
At the start of your click handler, try calling
this.Validate(); //here this is the form or usercontrol
CP
Christian Pogea
August 8, 2005 05:35 PM UTC
i get it in another way, too.
i have textboxes bound to a dataview and a griddataboundgrid also bound to the same dataview.
i push my "new" button. it fires EndCurrentEdit() and AddNew().
i enter some text and push the "new" button. now my datarow moves to somewhere in the grid, because the grid is sorted. if i select the the new datarow in the grid, the wrong datarow is viewed in the textboxes and this exceptin is fired:
System.InvalidOperationException: Do not move current position with this method!
at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.SyncCurrentRecordState(Int32 pos)
at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.OnCurrentCellActivated(EventArgs e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.RaiseCurrentCellActivated()
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Activate(Int32 rowIndex, Int32 colIndex, GridSetCurrentCellOptions options)
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.MoveTo(Int32 rowIndex, Int32 colIndex, GridSetCurrentCellOptions options, Boolean discardChanges)
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.MoveTo(Int32 rowIndex, Int32 colIndex, GridSetCurrentCellOptions options)
at Syncfusion.Windows.Forms.Grid.GridSelectCellsMouseController.MouseDown(MouseEventArgs e)
at Syncfusion.Windows.Forms.MouseControllerDispatcher.ProcessMouseDown(MouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControllMouseControllerDispatcher.ScrollControlBeforeMouseDown(Object sender, CancelMouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControl.OnScrollControlMouseDown(CancelMouseEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.OnScrollControlMouseDown(CancelMouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControl.RaiseCancelMouseEvent(MouseEventArgs e, CancelMouseDelegate d)
catched at Syncfusion.Windows.Forms.ScrollControl.RaiseCancelMouseEvent(MouseEventArgs e, CancelMouseDelegate d) in :line 0
AD
Administrator
Syncfusion Team
August 8, 2005 05:40 PM UTC
In your new button, try calling grid.CurrentCell.EndEdit and grid.Binder.EndEdit before you call AddNew.
CP
Christian Pogea
August 9, 2005 09:01 AM UTC
that still doesn''t help
AD
Administrator
Syncfusion Team
August 9, 2005 11:18 AM UTC
If you can upload a sample showing the problem, we can try to debug it here.
CP
Christian Pogea
August 10, 2005 04:31 PM UTC
push the "Neue Adresse" Button, enter "abcdefg" at "Name" and push the "Neue Adresse" Button.
now try to select your new record. after 1 or 2 seconds you get the exception.
CP
Christian Pogea
August 10, 2005 04:51 PM UTC
here is the link. the forum update doesn''t work.
http://aisnetwork.de/transfer/testGridBugAdressen.zip
AD
Administrator
Syncfusion Team
August 10, 2005 04:59 PM UTC
I am getting a page cannot be displayed error when I try to hit your link.
You can email the zip file to support@syncfusion.com and mention this thread in the subject line. Also post here that you sent it and I will get it.
CP
Christian Pogea
August 11, 2005 08:11 AM UTC
i send it to you right now.
AD
Administrator
Syncfusion Team
August 11, 2005 09:00 AM UTC
What version are you using? I do not see the exception in the latest code base.
I click the new button, type abcdef in the top textbox, click the new button again, and then click abcdef in the grid. This is when I should see the exceptions, correct?
CP
Christian Pogea
August 11, 2005 08:03 PM UTC
that''s right.
i''m using 3.201.1.0