and fix row index (off by one).
svn path=/trunk/mcs/; revision=83076
+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.
public DataGridViewRowCollection (DataGridView dataGridView)
{
- if (dataGridView == null) {
- throw new ArgumentException("DataGridView is null.");
- }
this.dataGridView = dataGridView;
list = new ArrayList ();
}
if (sharable && CanBeShared (dataGridViewRow)) {
dataGridViewRow.SetIndex (-1);
} else {
- dataGridViewRow.SetIndex (list.Count);
+ dataGridViewRow.SetIndex (list.Count - 1);
}
dataGridViewRow.SetDataGridView (dataGridView);