It seems like the issue you're facing is related to the timing of when the RowEditEnding
event is triggered in relation to when the row is actually added to the DataTable. The RowEditEnding
event might be fired before the changes are fully committed to the DataTable.
To ensure that you include the newly added row in your running sum calculation, you can try using the RowEditEnding
event to update the running sum after the changes have been committed. You can achieve this by handling the RowEditEnding
event and then updating the running sum within the Dispatcher
to postpone it until after the current event has been processed.
Private Sub MyGrid_RowEditEnding(sender As Object, e As DataGridRowEditEndingEventArgs) Handles MyGrid.RowEditEnding
Dispatcher.BeginInvoke(Sub()
RunningSum = CDec(MyTable.Compute("SUM(Amount)", ""))
End Sub, DispatcherPriority.ContextIdle)
End Sub
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.