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
close icon

Sorted GDBG exception when moving rows

I am moving rows around in a sorted grid by pressing a button (which says to start moving the currently selected row), then using the cellactivated event to indicate they have clicked on the row they want to move before. I then update the underlying data sandwiched between begin/end updates. When the method is complete the grid looks fine but throws the following exception (along with a message box). Invalid state: IsInMoveTo returns false Invalid state: IsInMoveTo returns false 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

3 Replies

AD Administrator Syncfusion Team April 20, 2006 06:20 AM UTC

Hi Chuck, This exception is thrown when some code is trying to access grid.CurrentCell.MoveToRowIndex or grid.CurrentCell.MoveToColIndex or (some of the other CurrentCell ''moving properties'') when the grid is not executing a CurrentCell.MoveTo. These properties are only valid if the grid is in the state of moving from one cell to another (& this is done through a CurrentCell.MoveTo call). So, check your code to see if it is trying to use one of these properties. If it is, then before you can try to use it, you should check grid.CurrentCell.IsInMoveTo. This will tell you when it is ok to try to use these properties.Here is a code snippet GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; if(cc.IsInMoveTo) //To check the state of moving cc.MoveTo(3,4); Let us know if this helps. Thanks for your interest in Syncfusion Products. Best Regards, Haneef


AD Administrator Syncfusion Team April 20, 2006 03:39 PM UTC

Nope doesn''t help at all. I am not calling any of the current cell move commands. I am only modifying the underlying data of the SORTED dataview which the grid is using as its datasource.


AD Administrator Syncfusion Team April 21, 2006 05:15 AM UTC

Hi Chuck, We have no other reports of this issue, and have not seen it in our many system.Can you post a small sample showing this problem or tell us how to see it in the Browser sample? Exactly what version of Windows are you using? What version of Syncfusion/(.NET framework and VS) are you using? Are you only installing Essential Grid or are you installing Essential Studio? Are you installing binaries only, or the source code version? Have you seen this on multipple systems? If you provide the more information, we can try to suggest some solution. Thanks for your patience. Regrads Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon