Hello,
to a XamDataGrid I bind a collection of simple objects.The collection is based on ObservableCollection<T> and additional implements IBindingListso it supports CurrentItem, object addings and removings.
I need the features of the ObservableCollection.The IBindingList I've only implemented, because without it the grid was not able to do AddNew rows at all.
This works well until I add the IsSynchronizedWithCurrentItem="True" option to the grid.As soon I add a new record but cancel it with Escape, an exception is thrown by the collection:Remove is not allowed while an AddNew or EditItem transaction (free translated from german).
I managed to circumvent this issue by catching the grids RecordUpdateCancelingand call the CommitNew() method of the collections IEditableCollectionView within the event handler.But I think of this as an ugly hack. Not only that calling CancelNew() isn't enough, I think it should be not needed at all to work proper.
To make life easier I added an working (exception throwing) sample.You find further issue related comments within MainWindow.xaml.cs
A great thank you in advance!
Hi,
I am glad that this fix works as expected.
The issue was fixed.The fix will be included in the october 2014 service releases.
Now the submitted issue is in state ‘In Review’. After our development team review it, it will be determined to be fixed or not.
I have provided them with your sample application.
Let me know, if you need any further assistance on this matter.
Hello Yanko,
okay, then I'll wait for a response. Any idea how long this will take? (response, not solution)Shouldn't the sample be added to the ticket?
Thank you.
I have logged this behavior with our developers in our tracking system, with an issue ID of 178220. I have also created a support ticket on your behalf with number CAS-142269-Q0Y2G4 in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.