Deleting Records after a Find

  • Thread starter Thread starter William Ryan
  • Start date Start date
W

William Ryan

dim row as datarowThis is a little different approach, but it will work for
you...
int i = dv.Find (val);
if (i > -1)
dv.Delete (i);
else {
//do nothing or alert the user
}
Just make sure that you haven't set allowdelete to
false. Also, after the delete the rowstate will
be .deleted .. if you need to undo it you'll need to use
rejectChanges on the DataTable that the View is based on.

Good Luck,

Bill


W.G. Ryan
www.knowdotnet.com
 
Great!!!

Thanks a bunch!!!


William Ryan said:
This is a little different approach, but it will work for
you...
int i = dv.Find (val);
if (i > -1)
dv.Delete (i);
else {
//do nothing or alert the user
}
Just make sure that you haven't set allowdelete to
false. Also, after the delete the rowstate will
be .deleted .. if you need to undo it you'll need to use
rejectChanges on the DataTable that the View is based on.

Good Luck,

Bill


W.G. Ryan
www.knowdotnet.com
 
Back
Top