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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top