|
-
Sep 25th, 2002, 09:10 AM
#1
Thread Starter
Fanatic Member
Question RE: AcceptChanges method
If I have an event handler for the DataTable.RowChanged event, and I change some data successfully, and then invoke AcceptChanges for that row, why does RowChanged fire two times? And if I invoke .AcceptChanges again right away for the same row, why does RowChanged fire again? Didn't I accept the changes for that row already, making the RowStatus Unchanged?
ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemdatadatarowclassacceptchangestopic.htm
ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemdatadatarowclassrowstatetopic.htm
Edit: Uh, after stepping through this process in the debugger I see that the RowChanged event has nothing to do with RowState - which makes me wonder how you properly set an event handler for a table to watch for changing data and not have it fire multiple times per change?
Last edited by Slow_Learner; Sep 25th, 2002 at 09:17 AM.
-
Sep 25th, 2002, 03:58 PM
#2
Thread Starter
Fanatic Member
Solved, workaround
Well poop on .RowChanged anyhow, the .ColumnChanged event does just as well for my purposes and doesn't fire twice when you .AcceptChanges.
Edit: Err - I'm not sure if this makes any sense, apparently the .RowChanged action fires for both the DataRowAction.Change and DataRowAction.Commit actions ... but DataRowAction.Change does not occur until you .Commit! What the hell?
I mean, you can examine the event args as in:
If e.Action = DataRowAction.Change Then
...
End If
But what were they thinking? I don't get it.
Last edited by Slow_Learner; Sep 25th, 2002 at 04:21 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|