I think this is very good point.
But it is out of my contorl. Deleteing multiple line by "Del" key and
raising deleted event are both build-in function of datagrid.
Maybe Microsoft should take your suggestion into account.
Ryan Liu
"Taras" <Ta***@discussions.microsoft.com> дÈëÓʼþ
news:18**********************************@microsof t.com...
Don't know if it applies in this case & don't have the details handy, but
whenever I've had to delete multiple rows, you have to start at the last
one and work your way up. Something about the id changing if you delete
working down
"Ryan Liu" wrote:
private void dt_RowDeleted(object sender, DataRowChangeEventArgs e)
{
int id= (int)e.Row["id", DataRowVersion.Original];
if(id >5)
{
e.Row.RejectChanges();
MessageBox.Show(this, "Can not delete!" + id);
}
}
When multile lines are selected and deleted from the datagrid by using
delete key.
The warning message showned by MessageBox.Show() always same. id never
changed, always the firt one.
Is this a known bug, any work around?
Thanks a lot!
Ryan Liu