DataGridView's Column.Visible property being changed to True from False

C

Crazy Cat

Here's a weird problem. I have a DataGridView in Visual Basic 2005
where I've set one of the columns Visible properties to False. However
when I run the application the column will inexplicably be displayed.
I've steppedthrough the code and determined that the state of this
column changes from False to true after I've called a tableadapter's
fill function. I've stepped as deep into the code as I can and have a
watch on the value, and see the value change after the function returns
(returning an integer). The integer value is actually not used at all,
as I call the function without setting any variable to the return
value. Has anyone seen this before? I have many DataGridViews in my
code, and this is the only one where I'm seeing this.

Thanks,

Crazy
 
C

Crazy Cat

More on this -- after some experimentation I found that this appears to
be an undocumented feature of DataGridViews -- the first column's
visible property cannot be set to false -- well actually you can set it
to false, but Windows will then reset it to true when running.

Thanks for reading,

Crazy
 

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