DataTable -, Row deleting

  • Thread starter Thread starter VJ
  • Start date Start date
V

VJ

I have inherited from the DataTable and have my own custom table. In this
Custom DataTable class I want to be able to cancel any row delete operation,
instead mark the row with Flag as deleted. The Table will always have Field
"FLAG" to which I can assign "DEL" saying it was deleted. How do I make sure
the row is never deleted but only marked as deleted

public class myTable : DataTable
{
public myTable()
{

this.RowDeleting+=new
DataRowChangeEventHandler(InsphyDataTable_RowDeleting);

}

private void InsphyDataSet_RowDeleting(object sender,
DataRowChangeEventArgs e)
{
//Mark row as deleted
e.Row["Flag"] = "DEL";
// How do I cancel delete here?
}

}

Also I want to able to know the sequence.. is RowChanging fired first and
the Row Deleted... WHat is the order of below events

RowChanging
RowChanged
RowDeleteing
RowDeleted

Thanks
VJ
 
Yea I saw that too... but the knew that... but that is not in my control I
am just implementing the Table, the user can still call AcceptChanges on
myTable. anyways Thanks for the Info, we figured another way for the
problem, we are not going inherit the DataTable..but the DataSet itself..and
see were we can go..

Thanks
VJ
 
Back
Top