[Mono-bugs] [Bug 548496] BindingSource throws exception when inserting objects of different types

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Dec 11 21:34:14 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=548496

http://bugzilla.novell.com/show_bug.cgi?id=548496#c1


Carlos Alberto Cortez <calberto.cortez at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |calberto.cortez at gmail.com

--- Comment #1 from Carlos Alberto Cortez <calberto.cortez at gmail.com> 2009-12-12 02:34:02 UTC ---
BindingSource *does* those checks. The attached sample shows exaclty what you
described: an arbitrary list with object of different type, and then a new
object is added, but we are getting an exception, just as .net *does* (an
InvalidOperationException, as described in
http://msdn.microsoft.com/es-es/library/system.windows.forms.bindingsource.add(VS.80).aspx
):


using System;
using System.ComponentModel;
using System.Windows.Forms;

public class Test
{
        static void Main ()
        {
                BindingList<object> list = new BindingList<object> ();
                list.Add ("hey");
                list.Add (7);

                BindingSource binding_source = new BindingSource ();
                binding_source.DataSource = list;

                // This call is generating the exception
                binding_source.Add (new object ());
        }
}


That's why we *ask* our users to provide a test case, because sometimes we are
missing some bits trying to reproduce an issue based on a description. So
please provide a small test case or solution.

-- 
Configure bugmail: http://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