[Windows.Forms] DataGridViewTextBoxCell: do not use a shared editing control
authorMiguel de Icaza <miguel@gnome.org>
Sat, 3 Jan 2015 14:42:22 +0000 (12:42 -0200)
committerMiguel de Icaza <miguel@gnome.org>
Sat, 3 Jan 2015 14:42:32 +0000 (12:42 -0200)
commita080a7d8a9f9942549cbaabd37f35282cabbb856
treeadc029ffce38f13cbab6c105759cc030633f6ba7
parent43aa9be05dc72ee531229060a98f82cd7d1790eb
[Windows.Forms] DataGridViewTextBoxCell: do not use a shared editing control

This fixes the case of the System.ObjectDisposedException being thrown
when editing a text cell in a DataGridView control a second time.

The problem is that the static control would be disposed by the code in
DataGridView's EditingControlInternal, but this instance was reused over
and over.

Instead, we now createa  new editing control every time that the TextBoxCell
is created.

The investigation for this bug took place here:

https://bugzilla.xamarin.com/show_bug.cgi?id=9653

Fixes also:

https://bugzilla.xamarin.com/show_bug.cgi?id=22297
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewTextBoxCell.cs