Hi,
I get following exception intermittently and finding it quite difficult to figure out:
Exception :Index was outside the bounds of the array. at Infragistics.Windows.DataPresenter.VirtualizingDataRecordCellPanel.GetFieldsInView() at Infragistics.Windows.DataPresenter.VisibleDataBlock.Create(List`1 recordPresenters) at Infragistics.Windows.DataPresenter.RecordsInViewHelper.ShouldProcessRecordManager(RecordManager rm, IList`1 fieldInfos) at Infragistics.Windows.DataPresenter.RecordsInViewHelper.ShouldProcessInViewRecord(Record record, IList`1 fieldInfos) at Infragistics.Windows.DataPresenter.AutoSizeFieldHelper.Calculate(RecordEnumeratorBase outOfViewRecords, AutoSizeCalculationFlags flags, RecordFieldList& recordFieldList, Boolean trackRecords, RecordsInViewHelper recordsInViewHelper) at Infragistics.Windows.DataPresenter.AutoSizeFieldHelper.Calculate(RecordCollectionBase records, Int32 recordManagerDepth, AutoSizeCalculationFlags flags, RecordsInViewHelper recordsInViewHelper) at Infragistics.Windows.DataPresenter.AutoSizeFieldLayoutInfo.PerformAutoSize(Boolean isHorz, IEnumerable`1 autoFields, RecordCollectionBase records, Int32 recordManagerDepth, HashSet recordsSubset, Boolean increaseOnly, OperationType operationType, FieldAutoSizeOptions allowedOptions, RecordsInViewHelper recordsInViewHelper) at Infragistics.Windows.DataPresenter.AutoSizeFieldLayoutInfo.InitializeAutoSizedFieldsImpl(RecordsInViewHelper recordsInViewHelper) at Infragistics.Windows.DataPresenter.AutoSizeFieldLayoutInfo.ProcessPendingOperationsImpl(RecordsInViewHelper recordsInViewHelper) at Infragistics.Windows.DataPresenter.AutoSizeFieldLayoutInfo.ProcessPendingOperations(List`1 pendingAutoSize, RecordsInViewHelper recordsInViewHelper) at Infragistics.Windows.DataPresenter.DataPresenterBase.ProcessPendingAutoSizeOperations() at Infragistics.Windows.DataPresenter.DataPresenterBase.OnPerformFieldAutoSize(Object parameter)
The stacktrace starts within the Infragistics component and inspecting the the dll I find that the exception originates from:
internal List<Field> GetFieldsInView() { List<Field> list = new List<Field>(); Rect clipRect = this.GetClipRect(base.RenderSize); this._lastFieldsInViewClipRect = clipRect; if ((this._fieldLayout != null) && (this._cellElementRects != null)) { foreach (Field field in this._fieldLayout.Fields) { int templateCellIndex = field.TemplateCellIndex; if (templateCellIndex >= 0) { Rect rect2 = this._cellElementRects[templateCellIndex]; if (!Rect.Intersect(clipRect, rect2).IsEmpty) { list.Add(field); } } } } return list; }
It looks it is probably from: this._cellElementRects[templateCellIndex]; since this seems to be a place where that type of exception might be thrown.
Since this doesn't happen all the time I am guessing this could be a race condition where the field.TemplateCellIndex is updated to be >=0 but the this._cellElementRects does not have this update yet. I do have some Visibility bindings to UnboundFields and ticking data so a wild guess would be that the Visibility binding is changing the TemplateCellIndex during the foreach loop.
I can't quite pin point how this is triggered and how to prevent it. Any help or ideas on where to start would be much appreciated.
Thanks
Hello,
Please ensure you are using the latest service release for 12.2.
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Hello all. I'm having a similar issue with version 12.2. I'm also binding visibility to my UnboundFields.
InnerException: System.IndexOutOfRangeException HResult=-2146233080 Message=Index was outside the bounds of the array. Source=InfragisticsWPF4.DataPresenter.v12.2 StackTrace: at Infragistics.Windows.DataPresenter.VirtualizingDataRecordCellPanel.Infragistics.Controls.Layouts.Primitives.ILayoutContainer.PositionItem(ILayoutItem item, Rect rect, Object containerContext) at Infragistics.Windows.DataPresenter.VirtualizingDataRecordCellPanel.ArrangeOverride(Size finalSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at Infragistics.Windows.Controls.CardPanel.ArrangeOverride(Size finalSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at System.Windows.Controls.DockPanel.ArrangeOverride(Size arrangeSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at Infragistics.Windows.Controls.CardPanel.ArrangeOverride(Size finalSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) at Infragistics.Windows.DataPresenter.RecordPresenter.ArrangeOverride(Size finalSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at Infragistics.Windows.DataPresenter.GridViewPanelFlat.ArrangeHelper(UIElement visualChildElement, Dictionary`2 headerRecordMap, Boolean orientationIsVertical, Boolean isReverseLayoutForBottomFixed, Double extentUsedByLastItem, Double clipExtent, Size arrangeSize, Rect& arrangeRect, Double& recordIndent) at Infragistics.Windows.DataPresenter.GridViewPanelFlat.ArrangeOverride(Size finalSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at System.Windows.ContextLayoutManager.UpdateLayout() at System.Windows.UIElement.UpdateLayout() at Infragistics.Windows.DataPresenter.GridUtilities.ProcessAsyncInvalidationsImpl() at Infragistics.Windows.DataPresenter.GridUtilities.ProcessAsyncInvalidations() InnerException:
Hello Eno,
Thank you for your response.
Please let me know if you have any issues after you are able to test the service release.
Developer Support Engineer
Thanks for the fix and following this up. However unfortunately I will have to wait until the firm brings in the service release to verify this.
Did the service release resolve your issue?
Sincerely,ValerieDeveloper Support Engineer Infragisticswww.infragistics.com/support