|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
RowState applied to whole table?!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. Show quote "rossu" <ro***@discussions.microsoft.com> wrote in message news:E844CA77-07C4-4D28-A9EE-640F0E687459@microsoft.com... >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? > > The embarassing answer is that I needed to invoke dataset.acceptchanges after
filling the dataset with readXML. Once I did that things behaved normally. Show quote "Marina" wrote: > I have never heard of this happening, nor have I experienced it. Perhaps you > should post a reproduceable example. > > "rossu" <ro***@discussions.microsoft.com> wrote in message > news:E844CA77-07C4-4D28-A9EE-640F0E687459@microsoft.com... > >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? > > > > > > > |
|||||||||||||||||||||||