problems with Excel 2003 and Window.Forms.DataGrid

L

Linas Mikutaitis

Hi all,

I have C# COM Add-in for Word/Excel 2000/2003 on MS Windows 2000 Pro SP4 and
the following problem occured with Excel 2003: when displaying Windows.Forms
modal dialog that contains Windows.Forms.DataGrid I get unhandled Exception
on DataGrid painting:

************** Exception Text **************
System.ArgumentException: Invalid parameter used.
at System.Drawing.Graphics.FillRectangle(Brush brush, Int32 x, Int32 y,
Int32 width, Int32 height)
at System.Drawing.Graphics.FillRectangle(Brush brush, Rectangle rect)
at System.Windows.Forms.DataGridParentRows.PaintBorder(Graphics g,
Rectangle bounds)
at System.Windows.Forms.DataGridParentRows.Paint(Graphics g, Rectangle
visualbounds, Boolean alignRight)
at System.Windows.Forms.DataGrid.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 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)

after that Grid is not displayed in the form (it's location is red crossed).
It works with Word 2003 though. After some investigation I'd found out that
setting ParentRowsVisible property of the grid to false doesn't crash grid's
painting but I in my case I need parent rows in grid so it's not the
resolution.
Is it a known bug and is there some kind of workaround?

thanks,
Linas M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top