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

GridDataBoundGrid : Exception

Customer Query :
In our application, we are using GridDataBoundGrid control (Syncfusion version - 3.3, .Net framework - 1.1). When I try to load the datagrid with datatable, sometimes it is throwing the following exceptions.

System.ArgumentException: Value does not fall within the expected range.
at Syncfusion.Windows.Forms.Grid.GridRangeInfo..ctor(Int32 top, Int32 left, Int32 bottom, Int32 right)
at Syncfusion.Windows.Forms.Grid.GridRangeInfo.InternalCells(Int32 top,Int32 left, Int32 bottom, Int32 right)
at Syncfusion.Windows.Forms.Grid.GridViewLayout.Initialize()
at Syncfusion.Windows.Forms.Grid.GridViewLayout.DemandInitialize()
at Syncfusion.Windows.Forms.Grid.GridViewLayout.get_LastVisibleRow()
at Syncfusion.Windows.Forms.Grid.GridControlBase.EndUpdateModel(Boolean update, Boolean fromModel)
at Syncfusion.Windows.Forms.Grid.GridControlBase.EndUpdate(Boolean update)
at Syncfusion.Windows.Forms.ScrollControl.EndUpdate() in C:\Program Files\Syncfusion\Essential Studio\3.3.0.0 \Base\Shared.Base\Src\Scrolling\ScrollControl.cs:line 4348
at Syncfusion.Windows.Forms.ScrollControl.CancelUpdate() in C:\Program Files\Syncfusion\Essential Studio\3.3.0.0 \Base\Shared.Base\Src\Scrolling\ScrollControl.cs:line 4358
at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg) in C:\Program Files\Syncfusion\Essential Studio\3.3.0.0 \Base\Shared.Base\Src\Scrolling\ScrollControl.cs:line 2890
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)
-----------------------------------------------------------------------

Stack Trace: at Syncfusion.Windows.Forms.Grid.GridRangeInfo..ctor(Int32 top, Int32 left, Int32 bottom, Int32 right)
at Syncfusion.Windows.Forms.Grid.GridRangeInfo.InternalCells(Int32 top,Int32 left, Int32 bottom, Int32 right)
at Syncfusion.Windows.Forms.Grid.GridViewLayout.Initialize()
at Syncfusion.Windows.Forms.Grid.GridViewLayout.DemandInitialize()
at Syncfusion.Windows.Forms.Grid.GridViewLayout.get_LastVisibleRow()
at Syncfusion.Windows.Forms.Grid.GridControlBase.EndUpdateModel(Boolean update, Boolean fromModel)
at Syncfusion.Windows.Forms.Grid.GridControlBase.EndUpdate(Booleanupdate)
at Syncfusion.Windows.Forms.ScrollControl.EndUpdate() in C:\Program Files\Syncfusion\Essential Studio\3.3.0.0 \Base\Shared.Base\Src\Scrolling\ScrollControl.cs:line 4348
at Syncfusion.Windows.Forms.ScrollControl.CancelUpdate() in C:\Program Files\Syncfusion\Essential Studio\3.3.0.0 \Base\Shared.Base\Src\Scrolling\ScrollControl.cs:line 4358
at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg) in C:\Program Files\Syncfusion\Essential Studio\3.3.0.0 \Base\Shared.Base\Src\Scrolling\ScrollControl.cs:line 2890
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)

-------------------------------------------------

System.InvalidProgramException: Grid is in updating mode
at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgspe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(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)

-----------------------------------------------------------------------
Stack Trace: at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(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)

Could you please let us know the cause of this exception and how to avoid this.

Thanks and Regards,
Vanitha

1 Reply

AD Administrator Syncfusion Team October 11, 2006 05:43 AM UTC

Hi Vanitha,

The error which you have mentioned, is an indication of threading issues.

Are there multiple threads involved in your appilcation? If so, please check the Knowledge Base(KB) article link below.

http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=78

Intermittant errors can be indications of threading issues. Any calls into the grid must be done on the thread that creates it, and you can use grid.InvokeRequired to check for this.

http://www.syncfusion.com/support/user/uploads/loaddatainbackgroundthread632254810888767829.zip

Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon