Home Forums WinForms controls Xceed Grid for WinForms System.InvalidOperationException in grid

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16128 |

    I am using xceedgrid 3.7

    I use grid in my application which contains the subgrid in each row of grid. While i trying to delete some or all rows then some time the following error occured and the grid filled by crossed red lines.

    Then I have to restart the application for clear crossed lines of the grid.

     Please help me to solve this problem.

     

    Following error occured some time while removing row —

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.InvalidOperationException: An attempt was made to synchronize with the scroll bars. For an unknown reason, it was impossible to synchronize with the scroll bars.
       at Xceed.Grid.PaintManager.SynchronizeWithScrollBars()
       at Xceed.Grid.PaintManager.CalculateGridRectangleAdjustedToScrollBar(Graphics graphics, Rectangle& gridRectangle)
       at Xceed.Grid.PaintManager.Update()
       at Xceed.Grid.PaintManager.GetGridClientRectangle()
       at Xceed.Grid.PaintManager.GetVisualGridElementAtPoint(Int32 x, Int32 y, Boolean excludeFixedColumnSplitter)
       at Xceed.Grid.GridControl.OnMouseEnter(EventArgs e)
       at System.Windows.Forms.Control.WmMouseEnter(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at Xceed.Grid.GridControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

     

     

     

    Imported from legacy forums. Posted by Sandip (had 3248 views)

    User (Old forums)
    Member
    Post count: 23064

    Sandip,

    Was there ever an answer to your InvalidOperationException?  I’m seeing the same error although I do get a little more:

    eError: 9/15/2008 12:50:18 PM    Unhandled exception occured:   

    The paint index must be equal to -1 when row is not initialized.
    Parameter name: paintIndex
    Actual value was 1., Xceed.Grid
       at Xceed.Grid.PaintManager.SetFirstVisibleBodyRow(Row row, Int32 paintIndex)
       at Xceed.Grid.PaintManager.SynchronizeWithScrollBars()
       at Xceed.Grid.PaintManager.CalculateGridRectangleAdjustedToScrollBar(Graphics graphics, Rectangle& gridRectangle)
       at Xceed.Grid.PaintManager.Update()
       at Xceed.Grid.PaintManager.GetGridClientRectangle()
       at Xceed.Grid.PaintManager.GetVisualGridElementAtPoint(Int32 x, Int32 y, Boolean excludeFixedColumnSplitter)
       at Xceed.Grid.GridControl.OnMouseEnter(EventArgs e)
       at System.Windows.Forms.Control.WmMouseEnter(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at Xceed.Grid.GridControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    System.InvalidOperationException: An attempt was made to synchronize with the scroll bars. For an unknown reason, it was impossible to synchronize with the scroll bars.

    Xceed.Grid

       at Xceed.Grid.PaintManager.SynchronizeWithScrollBars()
       at Xceed.Grid.PaintManager.CalculateGridRectangleAdjustedToScrollBar(Graphics graphics, Rectangle& gridRectangle)
       at Xceed.Grid.PaintManager.Update()
       at Xceed.Grid.PaintManager.GetGridClientRectangle()
       at Xceed.Grid.PaintManager.GetVisualGridElementAtPoint(Int32 x, Int32 y, Boolean excludeFixedColumnSplitter)
       at Xceed.Grid.GridControl.OnMouseEnter(EventArgs e)
       at System.Windows.Forms.Control.WmMouseEnter(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at Xceed.Grid.GridControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
                 STACK:    at Xceed.Grid.PaintManager.SynchronizeWithScrollBars()
       at Xceed.Grid.PaintManager.CalculateGridRectangleAdjustedToScrollBar(Graphics graphics, Rectangle& gridRectangle)
       at Xceed.Grid.PaintManager.Update()
       at Xceed.Grid.PaintManager.GetGridClientRectangle()
       at Xceed.Grid.PaintManager.GetVisualGridElementAtPoint(Int32 x, Int32 y, Boolean excludeFixedColumnSplitter)
       at Xceed.Grid.GridControl.OnMouseEnter(EventArgs e)
       at System.Windows.Forms.Control.WmMouseEnter(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at Xceed.Grid.GridControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    Imported from legacy forums. Posted by Justin (had 425 views)

    User (Old forums)
    Member
    Post count: 23064

    This is normally a threading issue.  If you are feeding data to the grid on a background thread, you must make sure the data is first sent to the main UI thread at all times.

    Imported from legacy forums. Posted by André (had 629 views)

    User (Old forums)
    Member
    Post count: 23064

    I used to get the same error message and for me it wasn’t threading related. I had used DataRow.BringIntoView() to focus to the selected row, I removed it and the error seems to disappear.

     

    Imported from legacy forums. Posted by Umit (had 2693 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.