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

System.ArgumentException: Value does not fall within the expected range.

Hi, Recently I m getting execution error as show below. This error only happens to me and the same src code and executable runs OK on other''s machine. Does anyone know why ? and what needs to check ? thanks Wing ERROR MSG:---- 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.RectangleToClientRowCol(Rectangle rect, Int32& topRow, Int32& leftCol, Int32& bottomRow, Int32& rightCol, GridCellSizeKind sizeKind) at Syncfusion.Windows.Forms.Grid.GridPaint.DrawGrid(Graphics g, Boolean shouldClip, Rectangle rectClip) at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe) catched at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe) in :line 0 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_VisibleRows() at Syncfusion.Windows.Forms.Grid.GridPaint.DrawClientRowCol(Int32 topRow, Int32 leftCol, Int32 bottomRow, Int32 rightCol, Graphics g, Rectangle rectClip) catched at Syncfusion.Windows.Forms.Grid.GridPaint.DrawClientRowCol(Int32 topRow, Int32 leftCol, Int32 bottomRow, Int32 rightCol, Graphics g, Rectangle rectClip) in :line 0 System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Windows.Forms.Grid.DrawStruct.Dispose(GridControlBase grid) at Syncfusion.Windows.Forms.Grid.GridPaint.DrawClientRowCol(Int32 topRow, Int32 leftCol, Int32 bottomRow, Int32 rightCol, Graphics g, Rectangle rectClip) at Syncfusion.Windows.Forms.Grid.GridControlBase.OnDrawClientRowCol(Int32 topRow, Int32 leftCol, Int32 bottomRow, Int32 rightCol, Graphics g, Rectangle rectClip) at Syncfusion.Windows.Forms.Grid.GridPaint.DrawGrid(Graphics g, Boolean shouldClip, Rectangle rectClip) at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe) catched at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe) in :line 0 Main Value does not fall within the expected range. The thread ''.NET SystemEvents'' (0xc84) has exited with code 0 (0x0). The program ''[3668] Main.exe'' has exited with code 0 (0x0).

3 Replies

PE Pua Eng Heng April 26, 2005 07:19 AM UTC

I have also encountered this error occasionally when rebinding the grid (i.e clear the grid data source and then rebind it with a new DataTable). This problem is quite random in nature and seems to happen more frequenctly in certain machine. Appreciate if Syncfusion can clarify this error. Regards Pua Eng Heng. >Hi, > >Recently I m getting execution error as show below. This error only happens to me and the same src code and executable runs OK on other''s machine. Does anyone know why ? and what needs to check ? > >thanks >Wing > >ERROR MSG:---- > >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.RectangleToClientRowCol(Rectangle rect, Int32& topRow, Int32& leftCol, Int32& bottomRow, Int32& rightCol, GridCellSizeKind sizeKind) > at Syncfusion.Windows.Forms.Grid.GridPaint.DrawGrid(Graphics g, Boolean shouldClip, Rectangle rectClip) > at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe) >catched at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe) in :line 0 >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_VisibleRows() > at Syncfusion.Windows.Forms.Grid.GridPaint.DrawClientRowCol(Int32 topRow, Int32 leftCol, Int32 bottomRow, Int32 rightCol, Graphics g, Rectangle rectClip) >catched at Syncfusion.Windows.Forms.Grid.GridPaint.DrawClientRowCol(Int32 topRow, Int32 leftCol, Int32 bottomRow, Int32 rightCol, Graphics g, Rectangle rectClip) in :line 0 >System.NullReferenceException: Object reference not set to an instance of an object. > at Syncfusion.Windows.Forms.Grid.DrawStruct.Dispose(GridControlBase grid) > at Syncfusion.Windows.Forms.Grid.GridPaint.DrawClientRowCol(Int32 topRow, Int32 leftCol, Int32 bottomRow, Int32 rightCol, Graphics g, Rectangle rectClip) > at Syncfusion.Windows.Forms.Grid.GridControlBase.OnDrawClientRowCol(Int32 topRow, Int32 leftCol, Int32 bottomRow, Int32 rightCol, Graphics g, Rectangle rectClip) > at Syncfusion.Windows.Forms.Grid.GridPaint.DrawGrid(Graphics g, Boolean shouldClip, Rectangle rectClip) > at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe) >catched at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe) in :line 0 >Main Value does not fall within the expected range. >The thread ''.NET SystemEvents'' (0xc84) has exited with code 0 (0x0). >The program ''[3668] Main.exe'' has exited with code 0 (0x0). >


CW Chun Wing Man April 26, 2005 09:26 AM UTC

I am not using DataTable, instead i m using the unbind grid method, refresh the grid rapidily. and eventually got this error soon...


AD Administrator Syncfusion Team April 26, 2005 08:41 PM UTC

Are you using Multiple threads in your application? If so please check this KB article. http://www.syncfusion.com/Support/article.aspx?id=572 It may be due to 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. If you are not using 3.2, can you please try in this version? There has been a change in the GridRangeInfo class to avoid an exception: // From 3.2 release notes *Added a check for top < 0 || left < 0 in GridRangeInfo.InternalCells to avoid exception being thrown. Thanks, Jay N

Loader.
Live Chat Icon For mobile
Up arrow icon