[Mono-bugs] [Bug 78919][Nor] Changed - Data Binding isn't working fine with numerical values

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Jul 21 09:04:46 EDT 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 alex.olk at googlemail.com.

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

--- shadow/78919	2006-07-21 04:08:28.000000000 -0400
+++ shadow/78919.tmp.11462	2006-07-21 09:04:46.000000000 -0400
@@ -38,6 +38,54 @@
 Additional information:
 Probably this error detection should be done for other types as well...
 
 ------- Additional Comments From unserkonig at gmail.com  2006-07-21 04:08 -------
 Sample at http://pastebin.ca/94401 (Sorry for the inconvenience, I'm
 having problems when uploading the test cases, again :-| ).
+
+------- Additional Comments From alex.olk at googlemail.com  2006-07-21 09:04 -------
+Copied from pastebin
+
+// Sample
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+
+// Simple class used as data source
+class Pal
+{
+        int age;
+
+        public int Age { // our numerical property
+                get {
+                        return age;
+                }
+                set {
+                        age = value;
+                }
+        }
+}
+
+public class Test : Form
+{
+        static void Main ()
+        {
+                Application.Run (new Test ());
+        }
+
+        public Test ()
+        {
+                Pal pal = new Pal ();
+
+                TextBox age_box = new TextBox ();
+                age_box.Location = new Point (5, 5);
+                age_box.DataBindings.Add (new Binding ("Text", pal,
+"Age")); // Text property bound to Int32 Pal.Age property
+                age_box.Parent = this;
+
+                // Helper text box, for changing focus
+                TextBox box = new TextBox ();
+                box.Location = new Point (5, age_box.Bottom + 5);
+                box.Parent = this;
+        }
+}
+


More information about the mono-bugs mailing list