* DataGridViewRowCollection.cs: Allow a null DGV in the constructor,
authorRolf Bjarne Kvinge <RKvinge@novell.com>
Tue, 31 Jul 2007 14:01:33 +0000 (14:01 -0000)
committerRolf Bjarne Kvinge <RKvinge@novell.com>
Tue, 31 Jul 2007 14:01:33 +0000 (14:01 -0000)
  and fix row index (off by one).

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

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

index f2df240611262c35313df6d79f7357d89433e37d..33e3156d2db99b7a785532dccd4afff5cb3303c6 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-31  Rolf Bjarne Kvinge <RKvinge@novell.com> 
+
+       * DataGridViewRowCollection.cs: Allow a null DGV in the constructor,
+         and fix row index (off by one).
+
 2007-07-31  Rolf Bjarne Kvinge <RKvinge@novell.com> 
 
        * PropertyGridView.cs: Remove debug output.
index ade6af3310b04042252bd55094448805922b102d..6770b98b960d3ad598f8b0eb4e85081735c326e7 100644 (file)
@@ -44,9 +44,6 @@ namespace System.Windows.Forms {
 
                public DataGridViewRowCollection (DataGridView dataGridView)
                {
-                       if (dataGridView == null) {
-                               throw new ArgumentException("DataGridView is null.");
-                       }
                        this.dataGridView = dataGridView;
                        list = new ArrayList ();
                }
@@ -123,7 +120,7 @@ namespace System.Windows.Forms {
                        if (sharable && CanBeShared (dataGridViewRow)) {
                                dataGridViewRow.SetIndex (-1);
                        } else {
-                               dataGridViewRow.SetIndex (list.Count);
+                               dataGridViewRow.SetIndex (list.Count - 1);
                        }
                        dataGridViewRow.SetDataGridView (dataGridView);