2009-01-09 Ivan N. Zlatev <contact@i-nz.net>
authorIvan Zlatev <ivan@ivanz.com>
Fri, 9 Jan 2009 14:52:04 +0000 (14:52 -0000)
committerIvan Zlatev <ivan@ivanz.com>
Fri, 9 Jan 2009 14:52:04 +0000 (14:52 -0000)
* BindingSource.cs: When adding a new item try to delegate to the internal
list first before throwing an exception.

svn path=/trunk/mcs/; revision=122897

mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingSource.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

index c0c80e03b381f9000c15958f777dc6d7f4b855fb..ff529859fcf0ce95f7a9e0cabf5cc6f97669357e 100644 (file)
@@ -624,10 +624,8 @@ namespace System.Windows.Forms {
                {
                        if (!AllowEdit)
                                throw new InvalidOperationException ("Item cannot be added to a read-only or fixed-size list.");
-                       if (!AllowNew || (!item_has_default_ctor && !IsAddingNewHandled)) 
-                               throw new InvalidOperationException ("AddNew cannot be called on '" + item_type.Name +
-                                               ", since it does not have a public default ctor. Set AllowNew to true " +
-                                               ", handling AddingNew and creating the appropriate object.");
+                       if (!AllowNew) 
+                               throw new InvalidOperationException ("AddNew is set to false.");
 
                        EndEdit ();
 
index 5bd1026e9bd6c4055b16b09fac6f960084e64663..d1f9dfcf0f3616d9cdcab64597d319f0a5fa8398 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-09  Ivan N. Zlatev  <contact@i-nz.net>
+
+       * BindingSource.cs: When adding a new item try to delegate to the internal 
+       list first before throwing an exception.
+
 2009-01-09  Carlos Alberto Cortez <calberto.cortez@gmail.com>
 
        * ComboBox.cs: When setting the text and adjusting the top_item, do it