Bug in DataGridView - invisible column turns visible...???

  • Thread starter Thread starter Johnny Jörgensen
  • Start date Start date
J

Johnny Jörgensen

In my current project I've got some DataGridViews containing multiple hidden
columns.

For some reason 8 of the 10 grids I've got on my form has suddenly started
showing 1 of the hidden columns (not all of them). If I look at the grids in
the designer, the columns ARE invisible, but still they're shown at runtime.

I cannot figure out why. I've searched the entire project to see if I could
find any code setting the columns visible, but there isn't any.

Has anybody got a suggestion?

Cheers,
Johnny J.
 
Not really, I tried posting screenshots though, but OE wouldn't let me do
that. Said the post was too large... :-(

I've got a Tab control with five tabs. On each tab I have 2 DataGridView
controls that are EXACTLY the same (the only difference is the displayed
data). All data comes from the same table but are filtered out into the 10
DataGridViews.

On the first tab everything is ok with the two DataGridViews, but on the 4
other tabs, the first column containing the ID is visible in both grids, and
if I check the designer properties, visible IS set to False for the columns.

I've tried searching the entire code and the visible property isn't changed
ANYWHERE (which I should also know seeing that I'm the only one developing
this application).

Strangely enough, sometimes it helps closing down Visual Studio and opening
it again. so it seems to be a VS problem more than a code problem.

As I said: I don't understand it...

Cheers,
Johhny J.
 
I get the same behavior in VB.NET '05 when I am closing a modal dialog form. I read on MSDN that the form's close() method should not be used when forms are opened using .ShowDialog(). You should use dispose() instead. This solved the issue for me.

Basically, the first time I enter the form, the columns were hidden as they should be. After closing the form with close(), subsequent visits to the form would show all columns as visible. When I closed the form with dispose(), subsequent visits rendered the columns as they were set in the designer.
 

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

Similar Threads


Back
Top