RowState applied to whole table?!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a datagrid and a bunch of validation routines that fire on column and
row changing events. I was amazed to discover that when I added a new row
the rowstate for every row in the table had changed to "Added". This caused
all sorts of problems for the validation routines since it meant that a
pre-existing row no longer had an original version to check (i.e. rows that
hadn't been modified returned false to hasversion(dataRowVersion.Original).
This seems like very bizaare behaviour to me! What's the point of each row
having its own rowstate if it only reflects what happened to the latest row.
I tried putting in a e.row.acceptchanges into the dataRowChanged event, which
executes, but the row states still all say "Added".

How do I get the rowstate of each row to reflect what has actually happened
to that row?
 
I have never heard of this happening, nor have I experienced it. Perhaps you
should post a reproduceable example.
 
The embarassing answer is that I needed to invoke dataset.acceptchanges after
filling the dataset with readXML. Once I did that things behaved normally.
 
Back
Top