[Mono-bugs] [Bug 417973] New: DataBinding: support multi-level dataMember strings

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Aug 18 07:10:26 EDT 2008


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


           Summary: DataBinding: support multi-level dataMember strings
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: andyhume32 at yahoo.co.uk
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=233862)
 --> (https://bugzilla.novell.com/attachment.cgi?id=233862)
Example tests patch

Mono only supports dataMember string one deep, as per current unit test:
[[
[Test]
public void DataSourcePropertyChanged ()
{
..
        MockItem item = new MockItem ("A", 0);
        Binding binding = new Binding ("Text", item, "Text");
]]

It needs to support multi-level references, e.g.
[[
[Test]
public void AndyH_DataSourcePropertyChanged_ThreeDeep ()
{
        Control c = new Control ();
        c.BindingContext = new BindingContext ();
        c.CreateControl ();

        MockItem item = new MockItem ("A", 0);
        One parent = new One ();
        parent.Two = new Two ();
        parent.Two.Three = new Three ();
        parent.Two.MockItem = item;
        Binding binding = new Binding ("Text", parent,
"Two.Three.MockItem.Text");

        c.DataBindings.Add (binding);
        Assert.AreEqual ("A", c.Text, "#A1");

        item.Text = "B";
        Assert.AreEqual ("B", c.Text, "#B1");
}
]]

A specimen diff to the tests is attached.


There's also the (very common) case where the root data object is a DataSet. 
There one gets dataMember strings like "customers.custToOrders.OrderAmount",
where "custToOrders" is a join between two tables.  There (obviously) aren't
any 'real' properties with those names on the DataSet and child objects,
instead they're accessed through IListSource and ICustomTypeDescriptor IIUC. 
I've created no simple repro created for that so far.


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


More information about the mono-bugs mailing list