Hello,
We're having a trouble binding XamGrid to a ListCollectionView. If I edit any row and cancel editing by pressing the Esc key, the ListCollectionView would not let me filter it anymore:
'Refresh' is not allowed during an AddNew or EditItem transaction.
It works fine when I commit the changes (either programmatically by using ExitEditMode(false) or by Enter key), but breaks the collection when modifications are cancelled.
I tried working around the issue by subsequently re-editing the row and committing it unchanged, but without any luck. Could anyone please help?
HI AntonK,
I was unable to reproduce your issue.
I bound the XamGrid to a ListCollectionView. I was able to cancel out of editing and was able to fitler.
My sample uses build 11.2.2076.
Pleae review my sample and feel free to modify it so that it replicates your issue.
Sincerely, Matt Developer Support Engineer
Hello Matt,
I attached a little modified sample where the bug is reproduced: there's now a textbox at the top of the window that filters the list by person name.
To reproduce the bug:
1. Enter "1" into the search field and see the filter working.2. Clear the search field.3. Edit any cell and cancel it.4. Try filtering once more and see the exception being thrown.5. Edit the same cell again and commit modifications with Enter.6. Try filtering and see it working fine once again.
Also, the search field always loses focus when the collection is refreshed, because xamGrid steals it's focus when the active cell is changed.
HI,
I am reviewing your new sample and steps.
Sincerely,Matt Developer Support Engineer
I reviewed your sample and made the following code changes. I wired up the CellExitingEditMode event
private void xgrid1_CellExitingEditMode(object sender, Infragistics.Controls.Grids.ExitEditingCellEventArgs e) { if (e.EditingCanceled) { vm.LCV.CommitEdit(); } }
This resolved the issue
MattDeveloper Support Engineer
Thank you! This helped a lot!