[Mono-bugs] [Bug 80607][Wis] New - ColumnHeader.Text should work after the ListView is disposed

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Jan 24 15:56:34 EST 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by georgegiolfan at yahoo.com.

http://bugzilla.ximian.com/show_bug.cgi?id=80607

--- shadow/80607	2007-01-24 15:56:34.000000000 -0500
+++ shadow/80607.tmp.28709	2007-01-24 15:56:34.000000000 -0500
@@ -0,0 +1,50 @@
+Bug#: 80607
+Product: Mono: Class Libraries
+Version: 1.2
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: georgegiolfan at yahoo.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ColumnHeader.Text should work after the ListView is disposed
+
+Description of Problem:
+Setting Text on a ColumnHeader that was added to a ListView which was 
+later disposed throws an exception.
+
+Steps to reproduce the problem:
+Compile and run the following program:
+using System;
+using System.Windows.Forms;
+class Test {
+    static void Main() {
+        ListView l = new ListView();
+        l.View = View.Details;
+        ColumnHeader c = new ColumnHeader();
+        l.Columns.Add(c);
+        l.Dispose();
+        c.Text = "";
+    }
+}
+Actual Results:
+An exception.
+
+Expected Results:
+No exception.
+
+How often does this happen? 
+Always (on the SVN version).
+
+Additional Information:
+The exception is thrown because setting the text tries to update the 
+ListView. I suggest adding a check in ColumnHeader.Text:
+if (owner != null && !owner.IsDisposed). This applies to many other 
+properties.


More information about the mono-bugs mailing list