I keep having the columns from some of my DataGridViews disappearing randomly in the designer, and of course then nothing shows up when I run the application either. Currently I can't even set the datasource to None and then back to my binding source (which has always worked in the past), so I guess I need to create a new DataGridView and rebind the datasource to it. The problem is I add several listeners, set column widths, etc. and I can't keep track of everything I do to every table (and I shouldn't have to!). And I am tired of redoing the same thing over and over again.
I have done a little searching and found that others have this problem and it may be a bug in Visual Studio (I am using Visual Studio Express 2013). So my question: Am I doing something to cause this and can I prevent it from happening again?
Edit
I have determined the cause, but still not the solution. It happens when I change the DataTable
behind the DataGridView
by, for instance, adding or removing a column in the DataTable
, and then add or remove that column to the DataGridView
. Once I do that, all of the columns disappear from the Designer, including any listener code, etc. I added. I would really appreciate some help on this since it happens to me all the time since I am working on a project with changing needs and it is impossible to have the DataTable
s be static at this point. And it is really hard to remember the column widths, what listeners/tooltips/etc. I added to which columns, etc. This totally seems like it is a bug in the Designer.