DataTable -, Row deleting
From: VJ (vijaybalki_at_yahoo.com)
Date: 03/16/05
- Next message: Infinite_Recursion: "adf"
- Previous message: Niels Flensted-Jensen: "RE: InvalidConstraintException when updating typed DataSet"
- Next in thread: Cor Ligthert: "Re: DataTable -, Row deleting"
- Reply: Cor Ligthert: "Re: DataTable -, Row deleting"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Mar 2005 14:00:14 -0600
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
- Next message: Infinite_Recursion: "adf"
- Previous message: Niels Flensted-Jensen: "RE: InvalidConstraintException when updating typed DataSet"
- Next in thread: Cor Ligthert: "Re: DataTable -, Row deleting"
- Reply: Cor Ligthert: "Re: DataTable -, Row deleting"
- Messages sorted by: [ date ] [ thread ]