[Mono-bugs] [Bug 324286] DataBinding: Invalid default value in bound combobox

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jan 7 15:00:13 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=324286

User calberto.cortez at gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=324286#c2





--- Comment #2 from Carlos Alberto Cortez <calberto.cortez at gmail.com>  2008-01-07 13:00:13 MST ---
using System;
using System.Drawing;
using System.Windows.Forms;

public class Pal
{
        object id;

        public object Id {
                get {
                        return id;
                }
                set {
                        id = value;
                }
        }
}

public class Test : Form
{
        object value = 666;

        static void Main ()
        {
                Test t = new Test ();
                t.Show ();

                Console.Write ("Value = ");
                if (t.Value == null)
                        Console.WriteLine ("<null>");
                else {
                        Console.Write (t.Value);
                        Console.WriteLine (", type = " + t.Value.GetType ());
                }
        }

        public object Value {
                get {
                        return value;
                }
                set {
                        this.value = value;
                }
        }

        public Test ()
        {
                // Observe that
                // a) Initial value of control property is NON null
                // b) Initial value of data source property IS null
                // c) final value of control property, after binding, is
System.DBNull
                DataBindings.Add ("Value", new Pal (), "Id");
        }
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list