Datagrid Red Cross (X) problem

P

pri_sh

I am trying to use a datagrid on a form in VB.NET. My datagrid is bound
to a dataset. When the form gets loaded, the datagrid does not display
and instead a big red cross appears. If you click on the grid, the
underlying cell comes into focus with its data. This only happens on a
machine with Windows 2000 not on WinXP. I tried everything on various
user groups but the issue still remains. I do not use any paint
override method. Also the dataset is not being changed when the error
occurs as this on the form load itself. Also, the stack trace says
error in OnPaint with message invalid paramter used. I tried try-catch
but it doesn't catch any error as it is inside the OnPaint.
One thing i noticed is that a datagrid on a form in a windows
application (exe) shows up, but my project is a class library being
used from another application. I do not know if this might be an issue.
I also tried just placing a datagrid without any associated code on the
same form and it didn't even come up as blank but just got the red
cross.

Can someone help me?
 
J

Jesper

I have had this happen with one of my views (not a datagrid) before. Once on
a win 98 machine where I was able to fix it by applying Service Pack 1 for
the .Net framework. And once on a Win2K machine (labtop), where I able to
fix it by Turning off "Hardware Acceleration" on my graphics card (something
like Display Properties -> Settings -> Advanced -> Troubleshoot page).
 
P

pri_sh

I tried doing that on the Win2k machine by turning of the hardware
accelration all the way to none and then couple of points in between,
but the red cross still comes.
Win2k machine has Ver 1.1 with SP1 for the .NET framwork.
 
P

pri_sh

I found a solution

Because my .NET DLL was used from a VB6 enviroment and with combination
of running on Windows 2000, the datagrid paint method throws and
exception. The actual exception occurs when datagrid tries to paint
ParentRows. As I did not need those, I set the ParentRowsVisible
property to False and it showed up on the Windows 2000 machine. I found
this on another user group when I searched "Invalid parameter exception
datagrid paint"

Hope this helps anyone
 

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