Re: Remove Row from a DataView
- From: MarkusJNZ@xxxxxxxxx
- Date: Thu, 07 Jun 2007 01:24:58 -0700
On Jun 7, 2:26 pm, Marc Gravell <marc.grav...@xxxxxxxxx> wrote:
but this does not seem to work
So what *does* happen? Does the count change?
First - you need to be very careful removing from a loop you are
iterating - the code you have is susceptible to cumulative "off by
one" errors every time it deletes - so with 2 adjacent youngsters only
the 1st would disappear. Perhaps iterate backwards instead? (or see
below).
There is no guarantee that the order is the same in the view and the
table (if a sort is set on the view), so if the wrong rows are
disappearing perhaps you should be removing from the view (which will
talk to the table).
Perhaps an easier option is to set a RowFilter against the view? that
way they simply don't appear, as opposed to removing them from the
system just because they can't buy beer (or whatever).
Marc
Hi Marc, thanks. I did think that I was getting off by one errors;
I will just use rowfilter
Thanks for your help
Markus
.
- References:
- Remove Row from a DataView
- From: MarkusJNZ
- Re: Remove Row from a DataView
- From: Marc Gravell
- Remove Row from a DataView
- Prev by Date: Re: Is const allowed anywhere?
- Next by Date: Re: static class inheritance, generalized
- Previous by thread: Re: Remove Row from a DataView
- Next by thread: Using Derived class
- Index(es):
Relevant Pages
|