+2003-11-09 Pedro Martínez Juliá <yoros@wanadoo.es>
+
+ * DataRowCollection.cs: To follow the specification: Remove and
+ RemoveAt should remove the row. But needed to call DeletingDataRow
+ to prepare the deleting.
+
+ * DataRow.cs: Don't call DeletingDataRow when it is called by the
+ method Table.Rows.Remove.
+
2003-11-09 Pedro Martínez Juliá <yoros@wanadoo.es>
* DataRowCollection.cs: Make the row be deleted by itself. If not,
[MonoTODO]\r
public void Delete () \r
{\r
- _table.DeletingDataRow(this, DataRowAction.Delete);\r
switch (rowState) {\r
case DataRowState.Added:\r
Table.Rows.Remove (this);\r
case DataRowState.Deleted:\r
throw new DeletedRowInaccessibleException ();\r
default:\r
+ _table.DeletingDataRow(this, DataRowAction.Delete);\r
// check what to do with child rows\r
CheckChildRows(DataRowAction.Delete);\r
rowState = DataRowState.Deleted;\r
+ _table.DeletedDataRow(this, DataRowAction.Delete);\r
break;\r
}\r
- _table.DeletedDataRow(this, DataRowAction.Delete);\r
}\r
\r
// check the child rows of this row before deleting the row.\r
int index = list.IndexOf(row);
if (index < 0)
throw new IndexOutOfRangeException ("The given datarow is not in the current DataRowCollection.");
- row.Delete();
+ table.DeletingDataRow(row, DataRowAction.Delete);
+ list.RemoveAt(index);
+ table.DeletedDataRow(row, DataRowAction.Delete);
}
/// <summary>
{
if (index < 0 || index >= list.Count)
throw new IndexOutOfRangeException ("There is no row at position " + index + ".");
-
DataRow row = (DataRow)list [index];
- row.Delete();
+ table.DeletingDataRow(row, DataRowAction.Delete);
+ list.RemoveAt(index);
+ table.DeletedDataRow(row, DataRowAction.Delete);
}
///<summary>