Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Datagridview bug : columns re-appear
 

Datagridview bug : columns re-appear

Hello all,

I have a strange bug in Visual Studio 2008.

I have developed a complete application with lots of forms containing DatagridViews .
The DatagridViews all have their property "DataSource" pointing to a BindingSource which is in the components tray of the form.
The BindingSources have their property "DataSource" pointing to a class. They are loaded with data on the form Load event.

In most cases, I use the "Edit Columns" fonction of the DatagridView to remove unnecessary columns.

When opening certain forms (not all of them)in Design Mode, I can see that the columns which have been "removed" have now reappeared !!
This happens only on some datagridviews, not all of them.
So, every time I open the form in Design mode, I have to "Remove" columns all over again !

I have not been able to understand what causes this behavior

Please help, I'm getting crazy !

Sygrien  Tuesday, September 01, 2009 7:01 PM
I have had this happen to me as well. I spent several hours trying to figure out any way to prevent this, but to no avail.

I assume it is a bug in the DataGridView control that is causing this. But it is odd in that it only happens in some cases. But it seems once it does happen to one particular DataGridView, it happens again and again and again.

I even compared, line by line, the designer file for a DataGridView that was *not* doing this to one that was and I found no differences.

If anyone else has figured out a way to prevent this ... I'd love to hear about it as well.

I know this does not help ... but at least you now it is not something you did!

www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
DeborahK  Tuesday, September 01, 2009 7:18 PM
DeborahK,

Yes, exact same thing !
Thanks a lot for this reply, it really helps morale !!
Let's hope it doesn't happen inVS2010 !
Sygrien  Tuesday, September 01, 2009 8:26 PM
Hello Sygrien,

Thanks for your post on MSDN forum.

It seems this is a known issue
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=278039

The current workaround is to not manually add data bound columns. I will feedback this issue to our product team inan internal channel. You are also welcome to add your supplements to make Microsoft products easier and more powerful to use by adding a ticket in the Connect Portal(https://connect.microsoft.com/VisualStudio)

Thanks,
Rong-Chun Zhang
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Rong-Chun Zhang  Wednesday, September 02, 2009 9:21 AM
Thanks Zhang,

Then it is a known issue !
It was present in VS2005 and is still there in VS2008...

Also, it seems the bug occurs when columns are either added or removed manually... Really nasty !
Sygrien  Wednesday, September 02, 2009 10:04 AM

Hello Sygrien,

Thanks for your feedback.

I've logged this issue on our internal database, product team will evaluate this in the furture. As we strive to capture any and all product feedback so as to ensure that we are continuously developing Microsoft products to meet customer needs, feedback such as yours is always taken very seriously. It will help us to make our products easier and more powerful to use.

Thanks,
Rong-Chun Zhang
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Rong-Chun Zhang  Tuesday, September 08, 2009 9:48 AM

You can use google to search for other answers

Custom Search

More Threads

• placing images in DataGridView control
• parameterizing data objects & binding
• autocomplete combobox : prevent user to insert value not in the autocompletesource
• datagridview
• BindingSource not pushing DataGridView changes.
• ComboBox Save Settings
• Combobox in datagridview -- containing list of values from another table when new grid row added
• Incrementing the Index by 1
• Custom DataGrid Combobox Column Style throws InvalidCastException on New Row
• My ComboBox changes the first item to whatever I select in it.