Bug 19567 - DataGridView crashes on Dispose when cell is in edit mode
Summary: DataGridView crashes on Dispose when cell is in edit mode
Alias: None
Product: Class Libraries
Classification: Mono
Component: Windows.Forms ()
Version: 3.4.0
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-05-06 12:51 UTC by eb1
Modified: 2014-05-06 17:40 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description eb1 2014-05-06 12:51:59 UTC
Calling Dispose on a DataGridView will crash if a cell happens to be in edit mode.

To reproduce, run the following unit test:

		private class MyDataGridView: DataGridView
			public void SetCurrentCell ()
				CurrentCell = Rows [1].Cells [1];
		public void TestDisposeWhenInEditMode ()
			var dgv = new MyDataGridView ();
			dgv.EditMode = DataGridViewEditMode.EditOnEnter;
			dgv.Columns.Add ("TestColumn", "Test column");
			dgv.Columns.Add ("Column2", "Second column");
			dgv.Rows.Add ();
			dgv.Rows.Add ();
			dgv.SetCurrentCell ();
			dgv.Dispose ();
Comment 1 eb1 2014-05-06 13:11:39 UTC
Suggested fix in PR #1018
Comment 2 eb1 2014-05-06 17:40:08 UTC
Merged in master 41858f8