[Mono-bugs] [Bug 77345][Nor] Changed - [PATCH] DataGridTextBoxColumn doesn't instantiate DataGridTextBox until Edit()

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jan 24 15:17:28 EST 2006

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 peter at novonyx.com.


--- shadow/77345	2006-01-24 12:13:35.000000000 -0500
+++ shadow/77345.tmp.21264	2006-01-24 15:17:28.000000000 -0500
@@ -1,23 +1,23 @@
 Bug#: 77345
 Product: Mono: Class Libraries
 Version: 1.0
+OS: unknown
 OS Details: Gentoo
 Status: NEW   
+Severity: Unknown
 Priority: Normal
 Component: Windows.Forms
-AssignedTo: peter at novonyx.com                            
+AssignedTo: jordimash at gmail.com                            
 ReportedBy: AdamWood at Xephi.co.uk               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
-Summary: DataGridTextBoxColumn doesn't instantiate DataGridTextBox until Edit()
+Summary: [PATCH] DataGridTextBoxColumn doesn't instantiate DataGridTextBox until Edit()
 Description of Problem:  
 The System.Windows.Forms.DataGridTextBoxColumn contains a property TextBox  
 that gets the underlying TextBox. Under Windows .NET this property  
 can be accessed immediately once the Column is created, however under Mono  
@@ -30,6 +30,16 @@
 col.TextBox.MouseDown += new MouseEventHandler(TextBoxMouseDownHandler);  
 Under .NET the above code will call the handler as expected.  
 Under Mono the above code throws a Null Pointer Exception. I would think 
 creating an instance of the TextBox in the column constructor should fix 
 this rather than lazily instantiating on the first call to Edit().
+------- Additional Comments From peter at novonyx.com  2006-01-24 15:17 -------
+Jordi, I am attaching a patch that would fix this. It still creates 
+the control lazily, but it now also creates it if the TextBox 
+property is used.
+It now creates it with Visible=false, and adds it to the list of the 
+datagrid controls right away, before some of the other stuff like 
+positioning is done, your original code had a tracking var to add 
+after setting all the other stuff, I hope the patch doesn't cause 
+problems by changing the order. Let me know if it's ok to commit.

More information about the mono-bugs mailing list