GridHeaderCellRenderer exception

Hi, I am using the data bound grid and binding to my own collection. When I attempt to display the grid, I get the following exception: "A first chance exception of type 'System.ArithmeticException' occurred in system.drawing.dll Additional information: Overflow or underflow in the arithmetic operation." If I try to bind and display in the Form load event, the grid never displays. If I bind and display on a button press in the form, then it displays with the [0,0] row and column red indicating an exception. Looks like a problem with Font initialization. (see attached stack trace, sorry I don't have the source yet....) Any ideas on the best work-around? Stack Trace: system.drawing.dll!System.Drawing.Font::Initialize(System.Drawing.FontFamily family = {Name="Microsoft Sans Serif"}, float emSize = 8.25, System.Drawing.FontStyle style = Bold, System.Drawing.GraphicsUnit unit = Point, unsigned char gdiCharSet = 1 '', bool gdiVerticalFont = false) + 0x4f bytes system.drawing.dll!System.Drawing.Font::Initialize(String* familyName = "Microsoft Sans Serif", float emSize = 8.25, System.Drawing.FontStyle style = Bold, System.Drawing.GraphicsUnit unit = Point) + 0x82 bytes system.drawing.dll!System.Drawing.Font::Font(String* familyName = "Microsoft Sans Serif", float emSize = 8.25, System.Drawing.FontStyle style = Bold) + 0x2a bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridFontInfo::get_GdipFont() + 0x55 bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridStyleInfo::get_GdipFont() + 0x4b bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridStyleInfo::get_GdipFont() + 0x8d bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridHeaderCellRenderer::OnDrawDisplayText(System.Drawing.Graphics g = {System.Drawing.Graphics}, System.Drawing.Rectangle textRectangle = {X=1 Y=1 Width=34 Height=19}, __int32 rowIndex = 0, __int32 colIndex = 0, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0x7c bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridHeaderCellRenderer::OnDraw(System.Drawing.Graphics g = {System.Drawing.Graphics}, System.Drawing.Rectangle clientRectangle = {X=0 Y=0 Width=36 Height=21}, __int32 rowIndex = 0, __int32 colIndex = 0, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0x5e9 bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridCellRendererBase::Draw(System.Drawing.Graphics g = {System.Drawing.Graphics}, System.Drawing.Rectangle cellRectangle = {X=0 Y=0 Width=36 Height=21}, __int32 rowIndex = 0, __int32 colIndex = 0, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0xb7 bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridStaticCellRenderer::Draw(System.Drawing.Graphics g = {System.Drawing.Graphics}, System.Drawing.Rectangle cellRectangle = {X=0 Y=0 Width=36 Height=21}, __int32 rowIndex = 0, __int32 colIndex = 0, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0x3c bytes> syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::OnDrawItem(System.Drawing.Graphics g = {System.Drawing.Graphics}, __int32 rowIndex = 0, __int32 colIndex = 0, System.Drawing.Rectangle rectItem = {X=0 Y=0 Width=36 Height=21}, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0x1b9 bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::DrawSpannedCell(Syncfusion.Windows.Forms.Grid.GridControlBase pGrid = {Syncfusion.Windows.Forms.Grid.GridDataBoundGrid}, System.Object pds = {Syncfusion.Windows.Forms.Grid.GridPaint.DrawStruct}, __int32 rowIndex = 0, __int32 colIndex = 0) + 0xe4d bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::InternalDrawCell(Syncfusion.Windows.Forms.Grid.GridPaint.DrawStruct ds = {Syncfusion.Windows.Forms.Grid.GridPaint.DrawStruct}, __int32 rowIndex = 0, __int32 colIndex = 0, bool spannedOnly = true) + 0xbc bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::DrawClientRowCol(__int32 topRow = 0, __int32 leftCol = 0, __int32 bottomRow = 25, __int32 rightCol = 16, System.Drawing.Graphics g = {System.Drawing.Graphics}) + 0x103b bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::OnDrawClientRowCol(__int32 topRow = 0, __int32 leftCol = 0, __int32 bottomRow = 25, __int32 rightCol = 16, System.Drawing.Graphics g = {System.Drawing.Graphics}) + 0x2b bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::DrawGrid(System.Drawing.Graphics g = {System.Drawing.Graphics}) + 0x17a bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::DrawGrid(System.Windows.Forms.PaintEventArgs pe = {ClipRectangle={X=0 Y=0 Width=1271 Height=433}}) + 0x28 bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::OnPaint(System.Windows.Forms.PaintEventArgs pe = {ClipRectangle={X=0 Y=0 Width=1271 Height=433}}) + 0x16b bytes system.windows.forms.dll!System.Windows.Forms.Control::PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs e = {ClipRectangle={X=0 Y=0 Width=1271 Height=433}}, short layer = 2, bool disposeEventArgs = false) + 0x85 bytes system.windows.forms.dll!System.Windows.Forms.Control::WmPaint(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x29e bytes system.windows.forms.dll!System.Windows.Forms.Control::WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x293 bytes syncfusion.shared.dll!Syncfusion.Windows.Forms.ScrollControl::WndProc(System.Windows.Forms.Message msg = {System.Windows.Forms.Message}) + 0x213 bytes syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::WndProc(System.Windows.Forms.Message msg = {System.Windows.Forms.Message}) + 0xac bytes system.windows.forms.dll!ControlNativeWindow::OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x19 bytes system.windows.forms.dll!ControlNativeWindow::WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes system.windows.forms.dll!System.Windows.Forms.NativeWindow::DebuggableCallback(__int32 hWnd = 656948, __int32 msg = 15, __int32 wparam = 0, __int32 lparam = 0) + 0x39 bytes

5 Replies

AD Administrator Syncfusion Team February 24, 2003 09:53 PM UTC

Can you post the code that you are using to bind your collection?


FC Franklin Colbert February 27, 2003 09:31 PM UTC

Turns out this is probably a buffer overrun in our ODBC driver.


FC Franklin Colbert February 27, 2003 09:32 PM UTC

Turns out this is probably a buffer overrun in our ODBC driver.


AD Administrator Syncfusion Team April 21, 2003 06:34 AM UTC

> Hi, > > I am using the data bound grid and binding to my own collection. When I attempt to display the grid, I get the following exception: > > "A first chance exception of type 'System.ArithmeticException' occurred in system.drawing.dll > > Additional information: Overflow or underflow in the arithmetic operation." > > If I try to bind and display in the Form load event, the grid never displays. If I bind and display on a button press in the form, then it displays with the [0,0] row and column red indicating an exception. Looks like a problem with Font initialization. (see attached stack trace, sorry I don't have the source yet....) Any ideas on the best work-around? > > Stack Trace: > > > > system.drawing.dll!System.Drawing.Font::Initialize(System.Drawing.FontFamily family = {Name="Microsoft Sans Serif"}, float emSize = 8.25, System.Drawing.FontStyle style = Bold, System.Drawing.GraphicsUnit unit = Point, unsigned char gdiCharSet = 1 '', bool gdiVerticalFont = false) + 0x4f bytes > > system.drawing.dll!System.Drawing.Font::Initialize(String* familyName = "Microsoft Sans Serif", float emSize = 8.25, System.Drawing.FontStyle style = Bold, System.Drawing.GraphicsUnit unit = Point) + 0x82 bytes > > system.drawing.dll!System.Drawing.Font::Font(String* familyName = "Microsoft Sans Serif", float emSize = 8.25, System.Drawing.FontStyle style = Bold) + 0x2a bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridFontInfo::get_GdipFont() + 0x55 bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridStyleInfo::get_GdipFont() + 0x4b bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridStyleInfo::get_GdipFont() + 0x8d bytes > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridHeaderCellRenderer::OnDrawDisplayText(System.Drawing.Graphics g = {System.Drawing.Graphics}, System.Drawing.Rectangle textRectangle = {X=1 Y=1 Width=34 Height=19}, __int32 rowIndex = 0, __int32 colIndex = 0, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0x7c bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridHeaderCellRenderer::OnDraw(System.Drawing.Graphics g = {System.Drawing.Graphics}, System.Drawing.Rectangle clientRectangle = {X=0 Y=0 Width=36 Height=21}, __int32 rowIndex = 0, __int32 colIndex = 0, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0x5e9 bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridCellRendererBase::Draw(System.Drawing.Graphics g = {System.Drawing.Graphics}, System.Drawing.Rectangle cellRectangle = {X=0 Y=0 Width=36 Height=21}, __int32 rowIndex = 0, __int32 colIndex = 0, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0xb7 bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridStaticCellRenderer::Draw(System.Drawing.Graphics g = {System.Drawing.Graphics}, System.Drawing.Rectangle cellRectangle = {X=0 Y=0 Width=36 Height=21}, __int32 rowIndex = 0, __int32 colIndex = 0, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0x3c bytes> > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::OnDrawItem(System.Drawing.Graphics g = {System.Drawing.Graphics}, __int32 rowIndex = 0, __int32 colIndex = 0, System.Drawing.Rectangle rectItem = {X=0 Y=0 Width=36 Height=21}, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0x1b9 bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::DrawSpannedCell(Syncfusion.Windows.Forms.Grid.GridControlBase pGrid = {Syncfusion.Windows.Forms.Grid.GridDataBoundGrid}, System.Object pds = {Syncfusion.Windows.Forms.Grid.GridPaint.DrawStruct}, __int32 rowIndex = 0, __int32 colIndex = 0) + 0xe4d bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::InternalDrawCell(Syncfusion.Windows.Forms.Grid.GridPaint.DrawStruct ds = {Syncfusion.Windows.Forms.Grid.GridPaint.DrawStruct}, __int32 rowIndex = 0, __int32 colIndex = 0, bool spannedOnly = true) + 0xbc bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::DrawClientRowCol(__int32 topRow = 0, __int32 leftCol = 0, __int32 bottomRow = 25, __int32 rightCol = 16, System.Drawing.Graphics g = {System.Drawing.Graphics}) + 0x103b bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::OnDrawClientRowCol(__int32 topRow = 0, __int32 leftCol = 0, __int32 bottomRow = 25, __int32 rightCol = 16, System.Drawing.Graphics g = {System.Drawing.Graphics}) + 0x2b bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::DrawGrid(System.Drawing.Graphics g = {System.Drawing.Graphics}) + 0x17a bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::DrawGrid(System.Windows.Forms.PaintEventArgs pe = {ClipRectangle={X=0 Y=0 Width=1271 Height=433}}) + 0x28 bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::OnPaint(System.Windows.Forms.PaintEventArgs pe = {ClipRectangle={X=0 Y=0 Width=1271 Height=433}}) + 0x16b bytes > > system.windows.forms.dll!System.Windows.Forms.Control::PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs e = {ClipRectangle={X=0 Y=0 Width=1271 Height=433}}, short layer = 2, bool disposeEventArgs = false) + 0x85 bytes > > system.windows.forms.dll!System.Windows.Forms.Control::WmPaint(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x29e bytes > > system.windows.forms.dll!System.Windows.Forms.Control::WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x293 bytes > > syncfusion.shared.dll!Syncfusion.Windows.Forms.ScrollControl::WndProc(System.Windows.Forms.Message msg = {System.Windows.Forms.Message}) + 0x213 bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::WndProc(System.Windows.Forms.Message msg = {System.Windows.Forms.Message}) + 0xac bytes > > system.windows.forms.dll!ControlNativeWindow::OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x19 bytes > > system.windows.forms.dll!ControlNativeWindow::WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes > > system.windows.forms.dll!System.Windows.Forms.NativeWindow::DebuggableCallback(__int32 hWnd = 656948, __int32 msg = 15, __int32 wparam = 0, __int32 lparam = 0) + 0x39 bytes > > > > >


AD Administrator Syncfusion Team May 13, 2003 02:52 AM UTC

> Hi, > > I am using the data bound grid and binding to my own collection. When I attempt to display the grid, I get the following exception: > > "A first chance exception of type 'System.ArithmeticException' occurred in system.drawing.dll > > Additional information: Overflow or underflow in the arithmetic operation." > > If I try to bind and display in the Form load event, the grid never displays. If I bind and display on a button press in the form, then it displays with the [0,0] row and column red indicating an exception. Looks like a problem with Font initialization. (see attached stack trace, sorry I don't have the source yet....) Any ideas on the best work-around? > > Stack Trace: > > > > system.drawing.dll!System.Drawing.Font::Initialize(System.Drawing.FontFamily family = {Name="Microsoft Sans Serif"}, float emSize = 8.25, System.Drawing.FontStyle style = Bold, System.Drawing.GraphicsUnit unit = Point, unsigned char gdiCharSet = 1 '', bool gdiVerticalFont = false) + 0x4f bytes > > system.drawing.dll!System.Drawing.Font::Initialize(String* familyName = "Microsoft Sans Serif", float emSize = 8.25, System.Drawing.FontStyle style = Bold, System.Drawing.GraphicsUnit unit = Point) + 0x82 bytes > > system.drawing.dll!System.Drawing.Font::Font(String* familyName = "Microsoft Sans Serif", float emSize = 8.25, System.Drawing.FontStyle style = Bold) + 0x2a bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridFontInfo::get_GdipFont() + 0x55 bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridStyleInfo::get_GdipFont() + 0x4b bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridStyleInfo::get_GdipFont() + 0x8d bytes > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridHeaderCellRenderer::OnDrawDisplayText(System.Drawing.Graphics g = {System.Drawing.Graphics}, System.Drawing.Rectangle textRectangle = {X=1 Y=1 Width=34 Height=19}, __int32 rowIndex = 0, __int32 colIndex = 0, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0x7c bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridHeaderCellRenderer::OnDraw(System.Drawing.Graphics g = {System.Drawing.Graphics}, System.Drawing.Rectangle clientRectangle = {X=0 Y=0 Width=36 Height=21}, __int32 rowIndex = 0, __int32 colIndex = 0, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0x5e9 bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridCellRendererBase::Draw(System.Drawing.Graphics g = {System.Drawing.Graphics}, System.Drawing.Rectangle cellRectangle = {X=0 Y=0 Width=36 Height=21}, __int32 rowIndex = 0, __int32 colIndex = 0, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0xb7 bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridStaticCellRenderer::Draw(System.Drawing.Graphics g = {System.Drawing.Graphics}, System.Drawing.Rectangle cellRectangle = {X=0 Y=0 Width=36 Height=21}, __int32 rowIndex = 0, __int32 colIndex = 0, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0x3c bytes> > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::OnDrawItem(System.Drawing.Graphics g = {System.Drawing.Graphics}, __int32 rowIndex = 0, __int32 colIndex = 0, System.Drawing.Rectangle rectItem = {X=0 Y=0 Width=36 Height=21}, Syncfusion.Windows.Forms.Grid.GridStyleInfo style = {Syncfusion.Windows.Forms.Grid.GridStyleInfo}) + 0x1b9 bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::DrawSpannedCell(Syncfusion.Windows.Forms.Grid.GridControlBase pGrid = {Syncfusion.Windows.Forms.Grid.GridDataBoundGrid}, System.Object pds = {Syncfusion.Windows.Forms.Grid.GridPaint.DrawStruct}, __int32 rowIndex = 0, __int32 colIndex = 0) + 0xe4d bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::InternalDrawCell(Syncfusion.Windows.Forms.Grid.GridPaint.DrawStruct ds = {Syncfusion.Windows.Forms.Grid.GridPaint.DrawStruct}, __int32 rowIndex = 0, __int32 colIndex = 0, bool spannedOnly = true) + 0xbc bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::DrawClientRowCol(__int32 topRow = 0, __int32 leftCol = 0, __int32 bottomRow = 25, __int32 rightCol = 16, System.Drawing.Graphics g = {System.Drawing.Graphics}) + 0x103b bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::OnDrawClientRowCol(__int32 topRow = 0, __int32 leftCol = 0, __int32 bottomRow = 25, __int32 rightCol = 16, System.Drawing.Graphics g = {System.Drawing.Graphics}) + 0x2b bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::DrawGrid(System.Drawing.Graphics g = {System.Drawing.Graphics}) + 0x17a bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridPaint::DrawGrid(System.Windows.Forms.PaintEventArgs pe = {ClipRectangle={X=0 Y=0 Width=1271 Height=433}}) + 0x28 bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::OnPaint(System.Windows.Forms.PaintEventArgs pe = {ClipRectangle={X=0 Y=0 Width=1271 Height=433}}) + 0x16b bytes > > system.windows.forms.dll!System.Windows.Forms.Control::PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs e = {ClipRectangle={X=0 Y=0 Width=1271 Height=433}}, short layer = 2, bool disposeEventArgs = false) + 0x85 bytes > > system.windows.forms.dll!System.Windows.Forms.Control::WmPaint(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x29e bytes > > system.windows.forms.dll!System.Windows.Forms.Control::WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x293 bytes > > syncfusion.shared.dll!Syncfusion.Windows.Forms.ScrollControl::WndProc(System.Windows.Forms.Message msg = {System.Windows.Forms.Message}) + 0x213 bytes > > syncfusion.grid.dll!Syncfusion.Windows.Forms.Grid.GridControlBase::WndProc(System.Windows.Forms.Message msg = {System.Windows.Forms.Message}) + 0xac bytes > > system.windows.forms.dll!ControlNativeWindow::OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x19 bytes > > system.windows.forms.dll!ControlNativeWindow::WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes > > system.windows.forms.dll!System.Windows.Forms.NativeWindow::DebuggableCallback(__int32 hWnd = 656948, __int32 msg = 15, __int32 wparam = 0, __int32 lparam = 0) + 0x39 bytes > > > > >

Loader.
Up arrow icon