Enumerator has been exhausted steps to occur
1.When data is shows in xamldatagrid and I removed 2-3 column randomly .
2.Again I perform query and get new data from database and assign to xamdatagrid
after repeating same steps 2-3 times I get error
Enumerator has been exhausted
Hello Jit,
Is it possible to provide a small, isolated sample application that demonstrates the behavior you are seeing? If it can be isolated, please upload a zip file. Having this information will help us to further investigate this for you.
Below is error for your reference .
Infragistics.Collections.SparseArray+CreateItemEnumerator, InfragisticsWPF4.v15.2, Version=15.2.20152.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb
at Infragistics.Collections.SparseArray.CreateItemEnumerator.EnsureNotExhausted() at Infragistics.Collections.SparseArray.CreateItemEnumerator.System.Collections.IEnumerator.MoveNext() at Infragistics.Windows.DataPresenter.RecordCollectionBase.RecordEnumeratorBase.MoveNext() at Infragistics.Windows.DataPresenter.AutoSizeFieldLayoutInfo.OutOfViewRecordEnumerable.Enumerator.MoveNext() at Infragistics.Windows.DataPresenter.AutoSizeFieldHelper.RecordEnumeratorBase.MoveNext() at Infragistics.Windows.DataPresenter.AutoSizeFieldHelper.Calculate(RecordEnumeratorBase outOfViewRecords, AutoSizeCalculationFlags flags, RecordFieldList& recordFieldList, Boolean trackRecords, RecordsInViewHelper recordsInViewHelper) at Infragistics.Windows.DataPresenter.AutoSizeFieldHelper.Calculate(IEnumerable`1 outOfViewRecords, Boolean recursive, Int32 recordManagerDepth, AutoSizeCalculationFlags flags) 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.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) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window)
.
I'm Wokring in corporate . So it's not possible to upload code online .It's come under policy violation
But i'll try .
Hello,
If will be useful if you can provide some more information about your scenario.
Do you use sorting in your grid? If you do, you can try calling RefreshSort() method of the Records collection:xamDataGrid1.Records.RefreshSort();
Or you can use the RecordUpdated event:
private void xamDataGrid1_RecordUpdated(object sender, Infragistics.Windows.DataPresenter.Events.RecordUpdatedEventArgs e) { e.Record.RefreshSortPosition(); }
Additionally if it is possible, send code you use to remove and add fields.
Yes .
Below are steps I'm doing
Worst thing is Application is crashed directly . End user facing lot of problem .
I tried xamDataGrid1.Records.RefreshSort() and RefreshSortPosition() It's doesn't achieve anything .I'm getting the SAME ERROR
Thank you for the details you have provided.
The functionality you are trying to achieve is strongly dependent on the implementation of the respective application and the best way for us to assist you will be if you provide a small isolated sample that we can run and use for debugging locally. If you are unable able to provide an isolated sample I may be able to give suggestions if you provide the code for your search button, records removing and the table and connections you are using.
If you are unable to share code or isolated sample application on the public forum, please let us know and we will open a private case for you.
Let me know if you require any further assistance on this matter.
Sincerely,ZhivkoAssociate Software Developer
I just want to add a suggestion to test your sample application with the latest Service Release of version 15.2, just in case if it has been an issue that is fixed in it.
Let me know if you have any questions.