Hi,
We keep getting index out of bounds exceptions when using the xamDataGrid with AllowRecordFiltering="True" .
What we are trying to do is to allow the user to switch layouts and their customizations. Since our fields are completely dynamically generated, we clear them and re-add them (we do not want to have them collapsed as this is causing performance issues for us, the fields get *removed* or added to the fieldlayout). Basically, when removing and re-adding fields, the grid throws exceptions.
This is true for v10.3 and v14.1 of the grid. It's not the exact same exception, but very similar when you switch between the two.
Attached is a sample project that shows this behavior, you can remove/add the references to see it with the 10.3 version and the 14.1 version.
Can you have a look please. In our production code we use the 10.3 version, that's the one we need working.
Thanks!
at Infragistics.Windows.DataPresenter.CellCollection.GetItem(Int32 index) at Infragistics.Windows.DataPresenter.CellCollection.get_Item(Int32 index) at Infragistics.Windows.DataPresenter.CellCollection.get_Item(Field field) at Infragistics.Windows.DataPresenter.FilterCellCollection.get_Item(Field field) at Infragistics.Windows.DataPresenter.FilterRecord.SetCellValue(Field field, Object value, Boolean useConverter, DataErrorInfo& errorInfo) at Infragistics.Windows.DataPresenter.DataRecord.SetCellValue(Field field, Object value, Boolean useConverter, Boolean addToUndo, Boolean suppressErrorDialog, Object undoValue, Boolean isCommittingEdit) at Infragistics.Windows.DataPresenter.DataRecord.SetCellValue(Field field, Object value, Boolean useConverter, Boolean addToUndo) at Infragistics.Windows.DataPresenter.DataRecord.SetCellValue(Field field, Object value, Boolean useConverter) at Infragistics.Windows.DataPresenter.CellValuePresenter.OnCoerceValue(Object value) at Infragistics.Windows.DataPresenter.CellValuePresenter.CoerceValue(DependencyObject target, Object value) at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp, PropertyMetadata metadata, EntryIndex& entryIndex, Int32& targetIndex, EffectiveValueEntry& newEntry, EffectiveValueEntry& oldEntry, Object& oldValue, Object baseValue, Object controlValue, CoerceValueCallback coerceValueCallback, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, Boolean skipBaseValueChecks) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at Infragistics.Windows.DataPresenter.CellValuePresenter.set_Value(Object value) at Infragistics.Windows.DataPresenter.FilterCellValuePresenter.OnFilterVersionChanged() at Infragistics.Windows.Internal.PropertyValueTracker.InvokeHandler() at Infragistics.Windows.Internal.PropertyValueTracker.ProcessTargetChanged() at Infragistics.Windows.Internal.PropertyValueTracker.OnTargetChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue) at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange) at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange) at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange) at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView) at MS.Internal.Data.ClrBindingWorker.OnSourcePropertyChanged(Object o, String propName) at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType) at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list) at System.ComponentModel.PropertyChangedEventManager.OnPropertyChanged(Object sender, PropertyChangedEventArgs args) at Infragistics.PropertyChangeNotifier.OnPropertyChanged(String propertyName) at Infragistics.PropertyChangeNotifier.RaisePropertyChangedEvent(String propertyName) at Infragistics.Windows.DataPresenter.FilterCell.OnFieldFilterInfo_PropertyChanged(Object sender, PropertyChangedEventArgs e) at Infragistics.PropertyChangeNotifier.OnPropertyChanged(String propertyName) at Infragistics.PropertyChangeNotifier.RaisePropertyChangedEvent(String propertyName) at Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.FieldFilterInfo.VerifyRecordFilter() at Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.FieldFilterInfo.OnFiltersChanged() at Infragistics.Windows.Internal.PropertyValueTracker.InvokeHandler() at Infragistics.Windows.Internal.PropertyValueTracker.ProcessTargetChanged() at Infragistics.Windows.Internal.PropertyValueTracker.OnTargetChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue) at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange) at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange) at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange) at MS.Internal.Data.PropertyPathWorker.OnDependencyPropertyChanged(DependencyObject d, DependencyProperty dp, Boolean isASubPropertyChange) at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args) at System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args) at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args) at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at System.Windows.DependencyObject.SetValue(DependencyPropertyKey key, Object value) at Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.BumpVersion() at Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.OnSourceFiltersChanged() at Infragistics.Windows.Internal.PropertyValueTracker.InvokeHandler() at Infragistics.Windows.Internal.PropertyValueTracker.ProcessTargetChanged() at Infragistics.Windows.Internal.PropertyValueTracker.OnTargetChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue) at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange) at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange) at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange) at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView) at MS.Internal.Data.ClrBindingWorker.OnSourcePropertyChanged(Object o, String propName) at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType) at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list) at System.ComponentModel.PropertyChangedEventManager.OnPropertyChanged(Object sender, PropertyChangedEventArgs args) at Infragistics.Windows.DataPresenter.RecordFilterCollection.RaisePropertyChanged(String propertyName) at Infragistics.Windows.DataPresenter.RecordFilterCollection.BumpVersion() at Infragistics.Windows.DataPresenter.RecordFilterCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Infragistics.Windows.DataPresenter.RecordFilterCollection.ClearItems() at Infragistics.Windows.DataPresenter.FieldLayout.ClearCustomizations(CustomizationType customizations) at Infragistics.Windows.DataPresenter.CustomizationsManager.ClearCustomizations(FieldLayout fieldLayout, CustomizationType customizations) at Infragistics.Windows.DataPresenter.CustomizationsManager.ClearCustomizations(CustomizationType customizations) at Infragistics.Windows.DataPresenter.DataPresenterBase.ClearCustomizations(CustomizationType customizations) at LoadCustomizationsProblem.MainWindow.ReplaceFields(String customs2) in c:\Users\cristc\Code Sources\CSharp Projects\LoadCustomizationsProblem\LoadCustomizationsProblem\MainWindow.xaml.cs:line 54
Hello Cristian,
We have shipped out a new service release where your issue is resolved. I'd be glad to find out if you had tested it out and if it had met your requirements.
You can download the Service Releases by logging to our web site and going to Account \Keys & Downloads.
https://ko.infragistics.com/my-account/keys-and-downloads/
I have logged this with development under ID: 176881 and I have also created a support ticket on your behalf: CAS-141256-T3L4Q2 and have linked the development issue to it, so that you can get automatically updated, when a Service Release containing the fix is available for download. You can get the new version from our website’s “My IG”, “My Keys & Downloads” tags: https://ko.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
You can also monitor the support ticket’s progress through the “My Support Activity” tag: https://ko.infragistics.com/Membership/MySupport.aspx
Please note that since version 10.3 is retired, we no longer provide fixes for it, so this will be fixed in our supported version 13.2 and 14.1.
Hi Stefan,
Thank you for your answer. I am well aware that "otherwise the collection is empty and this is why you get an Index out of range exception". I mean that's what the exception tells you "I am trying to fetch an item that doesn't exist" and we know the collection is empty. The real question for you is why does your code try to fetch an item in an empty collection? I have given you a sample project that clearly shows this bug in your product. Maybe, just maybe, an appropriate action is for you to bring it up to your developers attention, let your customer know you did that, then stating the obvious won't make you look so much like a condescending douche. Or, at the very least, if raising bugs isn't your responsibility, giving the appropriate steps for me to follow so I can file this bug with the appropriate team within your organization.
Anyway, let's analyse the situation a bit.1. The bug can be reproduced in about 5 lines of code.2. I have given you an obscure work around that is inspired by the winforms era ( _grid.Dispatcher.Invoke(new Action(() => { }));), clearly showing you that my team and I spent quite a bit of time trying to figure this one out with possible workarounds.3. In the sample we gave you we went so far as to even try it out with the latest version of your product (so that we have a reason to push for an upgrade in front of our managers), giving you yet another hint that we really spent quite a bit of time on this.
Now given that, do you really think that we haven't tried something so simple as to move one line of code in front of the others?
In case the answer isn't obvious yet, we did try that. Actually, that's exactly how are production code is, first ClearCustomizations then remove all the fields, then add the fields we want, then load another set of customizations. We get the same exception, but it's the LoadCostomizations that throws it, not the ClearCustomizations. Please see the exception stacktrace below. Notice that it's very similar to the exception you get from the sample project. I bet you that if you fix the exception from the sample project, you fix the exception from our production code.
To be honest, we don't know why we can't reproduce the exception in the sample project we gave you following the exact same steps as our production code. However, we have spent enough time on spoon feeding you a bug report and do not wish to spend more on it unless you have a serious fix/workaround for us.
Just for the record, it's been four years that I deal with this grid, and hence, four years that I read your posts on this forum. I purposely left out the part telling you this sample works if you move the ClearCustomization before clearing the fields. Just wanted to see if you'll just scratch the surface and come back with the obvious or if you realize that this is a bug within your product, care about making your product better and raise the bug with your developers so that it gets fixed eventually.
In retrospect, what was I thinking... it's not like it's the first condescending reply you have give out.
Could Infragistics give us a solution that doesn't throw an exception regardless where the ClearCustomizations is placed with the 10.3 version? Or in the case of 14.1 version, a solution where removing and adding a field (regardless of the customizations) doesn't throw a similar exception.
Thanks,Cristian
at Infragistics.Windows.DataPresenter.CellCollection.GetItem(Int32 index)at Infragistics.Windows.DataPresenter.CellCollection.get_Item(Int32 index)at Infragistics.Windows.DataPresenter.CellCollection.get_Item(Field field)at Infragistics.Windows.DataPresenter.FilterCellCollection.get_Item(Field field)at Infragistics.Windows.DataPresenter.FilterRecord.SetCellValue(Field field, Object value, Boolean useConverter, DataErrorInfo& errorInfo)at Infragistics.Windows.DataPresenter.DataRecord.SetCellValue(Field field, Object value, Boolean useConverter, Boolean addToUndo, Boolean suppressErrorDialog, Object undoValue, Boolean isCommittingEdit)at Infragistics.Windows.DataPresenter.DataRecord.SetCellValue(Field field, Object value, Boolean useConverter, Boolean addToUndo)at Infragistics.Windows.DataPresenter.DataRecord.SetCellValue(Field field, Object value, Boolean useConverter)at Infragistics.Windows.DataPresenter.CellValuePresenter.OnCoerceValue(Object value)at Infragistics.Windows.DataPresenter.CellValuePresenter.CoerceValue(DependencyObject target, Object value)at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp, PropertyMetadata metadata, EntryIndex& entryIndex, Int32& targetIndex, EffectiveValueEntry& newEntry, EffectiveValueEntry& oldEntry, Object& oldValue, Object baseValue, Object controlValue, CoerceValueCallback coerceValueCallback, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, Boolean skipBaseValueChecks)at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)at Infragistics.Windows.DataPresenter.CellValuePresenter.set_Value(Object value)at Infragistics.Windows.DataPresenter.FilterCellValuePresenter.OnFilterVersionChanged()at Infragistics.Windows.Internal.PropertyValueTracker.InvokeHandler()at Infragistics.Windows.Internal.PropertyValueTracker.ProcessTargetChanged()at Infragistics.Windows.Internal.PropertyValueTracker.OnTargetChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)at System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange)at MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange)at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)at MS.Internal.Data.ClrBindingWorker.OnSourcePropertyChanged(Object o, String propName)at MS.Internal.Data.PropertyPathWorker.OnPropertyChanged(Object sender, PropertyChangedEventArgs e)at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)at System.ComponentModel.PropertyChangedEventManager.OnPropertyChanged(Object sender, PropertyChangedEventArgs args)at Infragistics.PropertyChangeNotifier.OnPropertyChanged(String propertyName)at Infragistics.PropertyChangeNotifier.RaisePropertyChangedEvent(String propertyName)at Infragistics.Windows.DataPresenter.FilterCell.OnFieldFilterInfo_PropertyChanged(Object sender, PropertyChangedEventArgs e)at Infragistics.PropertyChangeNotifier.OnPropertyChanged(String propertyName)at Infragistics.PropertyChangeNotifier.RaisePropertyChangedEvent(String propertyName)at Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.FieldFilterInfo.VerifyRecordFilter()at Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.FieldFilterInfo.OnFiltersChanged()at Infragistics.Windows.Internal.PropertyValueTracker.InvokeHandler()at Infragistics.Windows.Internal.PropertyValueTracker.ProcessTargetChanged()at Infragistics.Windows.Internal.PropertyValueTracker.OnTargetChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)at System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange)at MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange)at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)at MS.Internal.Data.PropertyPathWorker.OnDependencyPropertyChanged(DependencyObject d, DependencyProperty dp, Boolean isASubPropertyChange)at MS.Internal.Data.ClrBindingWorker.OnSourceInvalidation(DependencyObject d, DependencyProperty dp, Boolean isASubPropertyChange)at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)at System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)at System.Windows.DependencyObject.SetValue(DependencyPropertyKey key, Object value)at Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.BumpVersion()at Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.OnSourceFiltersChanged()at Infragistics.Windows.Internal.PropertyValueTracker.InvokeHandler()at Infragistics.Windows.Internal.PropertyValueTracker.ProcessTargetChanged()at Infragistics.Windows.Internal.PropertyValueTracker.OnTargetChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)at System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange)at MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange)at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)at MS.Internal.Data.ClrBindingWorker.OnSourcePropertyChanged(Object o, String propName)at MS.Internal.Data.PropertyPathWorker.OnPropertyChanged(Object sender, PropertyChangedEventArgs e)at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)at System.ComponentModel.PropertyChangedEventManager.OnPropertyChanged(Object sender, PropertyChangedEventArgs args)at System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)at Infragistics.Windows.DataPresenter.RecordFilterCollection.RaisePropertyChanged(String propertyName)at Infragistics.Windows.DataPresenter.RecordFilterCollection.BumpVersion()at Infragistics.Windows.DataPresenter.RecordFilterCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e)at System.Collections.ObjectModel.ObservableCollection`1.ClearItems()at Infragistics.Windows.DataPresenter.RecordFilterCollection.ClearItems()at System.Collections.ObjectModel.Collection`1.Clear()at Infragistics.Windows.DataPresenter.CustomizationsManager.LoadRecordFilters(FieldLayout fieldLayout, XmlNode filtersNode, FieldLayoutCustomizationInfo info)at Infragistics.Windows.DataPresenter.CustomizationsManager.ApplyCustomizations()at Infragistics.Windows.DataPresenter.CustomizationsManager.LoadCustomizations(Stream stream)at Infragistics.Windows.DataPresenter.CustomizationsManager.LoadCustomizations(String customizations)at Infragistics.Windows.DataPresenter.DataPresenterBase.LoadCustomizations(String Customizations)at OUR CODE\OUR FILE.cs:line 1614
Hello Christian,
Thank you for your post. I have been looking into it and the sample you have attached and I can suggest you call the ClearCustomization method before you clear the Fields collection, because otherwise the collection is empty and this is why you get an “Index out of range exception”. Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.