Hello,
I have a content presenter, which using a templateSelector decides if i want to show a XamGrid or another control.
My XamGrid has validation, when i want to add a row with not valid data, and than trying to change the DataContext and the ItemsSource of the XamGriw (without exiting adding new row), i get the following exception:
{"Exception has been thrown by the target of an invocation."}
with stacktrace:
at Infragistics.Controls.Grids.XamGrid.ExitCellFromEditModeInternalRow(Boolean cancel) at Infragistics.Controls.Grids.XamGrid.ExitEditModeInternal(Boolean cancel) at Infragistics.Controls.Grids.XamGrid.ExitEditMode(Boolean cancel) at Infragistics.Controls.Grids.RowsManager.InvalidateFiltering() at Infragistics.Controls.Grids.RowsManager.InvalidateData() at Infragistics.Controls.Grids.RowsManager.OnItemsSourceChanged(Boolean invalidateSelectionAndActivation) at Infragistics.Controls.Grids.RowsManager.set_ItemsSource(IEnumerable value) at Infragistics.Controls.Grids.XamGrid.ApplyItemSource(IEnumerable itemSource) at Infragistics.Controls.Grids.XamGrid.ItemsSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Can you help me how to solve this problem?
Hello Michael,
I have been reading through your description and am not quite sure what might be causing this issue, so I was wondering if you have tried this without the TemplateSelector and if you have a project I can look at that reproduces this?
Looking forward to hearing from you.
Hi,
It is very hard to isolate this from my project to send you.
Anyway, This exception happens only when a cell has validation error , and than when i am changing the DataContext and the ItemsSource of the XamGrid, This exception is thrown.
When there is no cell validation error, and i am still changing the DataContext and ItemsSource, everything works fine.
So i don't think it is related to the TemplateSelector
It seems that the XamGrid doesnt ExitEditRow after cell validation error. So i need to do it manually, which i think is wrong. Anyway, i think it is XamGRid bug
I am still following your case. I am just checking the progress of this and if you need any more assistance.