[Mono-dev] Patches for mono-winforms

Stifu stifu at free.fr
Tue Aug 7 18:30:57 UTC 2012


Sounds good. But you can probably tell what's on my mind... Is it testable?


Steven Boswell II wrote
> 
> https://github.com/mono/mono/commit/ecef298bcaf571a3d50e022318b20117f9d0388c
> introduced another bug that I found today.  Enclosed is the fix.
> 
> 
> DataGridViewTextBoxCell was creating a single (as in static) instance
> of DataGridViewTextBoxEditingControl to do all editing.  This fails if one
> edits two text-box cells, because ending the first edit calls Dispose() on
> the static instance, and the second attempt to edit throws an
> ObjectDisposedException.
> 
> The solution is to use the control created by DataGridView, instead of
> maintaining a single static control.
> 
> Incidentally, this also fixes a bug that I hadn't yet taken the time to
> track down.
>  http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.editingcontrolshowing.aspx mentions
> that DataGridView reuses the editing control whenever the cell type does
> not change between edits, and so any event-handlers placed on the control
> during the EditingControlShowing event should be removed.  For this to
> work, control reuse could not be across multiple instances of DataGridView
> -- the event-handlers put onto editing-controls by other DataGridView
> instances would be unknowable.  The previous static-instance code had this
> flaw; I noticed that event-handlers seemed to accumulate on text-box
> editing controls across data-grid-views when using Mono, even though I was
> following the recommended procedure, and that it wasn't happening under
> .NET and MS Windows.  But no one would have noticed this
> 
> until https://github.com/mono/mono/commit/f9bea537f1ac41753f2204b8528a6292bb547111
> (about 2 months ago), when the EditingControlShowing event was posted for
> the first time. :-)
> 
> Steven Boswell
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at .ximian
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 




--
View this message in context: http://mono.1490590.n4.nabble.com/Patches-for-mono-winforms-tp4650777p4650792.html
Sent from the Mono - Dev mailing list archive at Nabble.com.


More information about the Mono-devel-list mailing list