Hello,
I am using TokenLookUpEdit control in my project, I am facing an issue Exception) which seems to be triggered from the inner code of TokenLookupEdit control, following is the stack trace.
"Sequence contains no elements"
at System.Linq.Enumerable.Last[TSource](IEnumerable`1 source)
at DevExpress.Xpf.Editors.Internal.TokenEditorWrapLineMeasureStrategy.MeasureLinesOnScrollDown(Size constraint, TokenEditorLineInfo newOffsetLine)
at DevExpress.Xpf.Editors.Internal.TokenEditorWrapLineMeasureStrategy.MeasureOldLines(Size constraint, Int32 newOffsetLineIndex, TokenEditorLineInfo newOffsetLine)
at DevExpress.Xpf.Editors.Internal.TokenEditorWrapLineMeasureStrategy.Measure(Size constraint)
at DevExpress.Xpf.Editors.Internal.TokenEditorPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
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.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
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 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.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at TokenLookUpEdit.App.Main() in d:\KSR\DevExpress Bugs\TokenLookup Edit\15.1.7\TokenLookUpEdit\TokenLookUpEdit\TokenLookUpEdit\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
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 System.Threading.ThreadHelper.ThreadStart()
Steps to reproduce:
1- Execute the attached demo project.
2- I have added different students with Test long names, for test type "A" It will open a list, select one entry, then add multiple entries till the vertical scroll is enabled.
3- Now scroll down, as soon as the scroll reaches the bottom area you will see the application will crash with above exception and sometimes (ArgumentOutOfRangeException)
It looks like to be related to width of selected token.
Could you please let me know how to fix it?
Regards.
Hello,
Thank you for providing the test project. However, I cannot replicate this issue on our side. I have attached a screencast illustrating my actions. Please take a moment to review it. Probably, I missed something essential.
Thanks,
Elliot
Thanks Elliot for your reply. Surprisingly I can easily replicate this issue on my machine. I have tested it on 5 different machines. Having Windows 7 Enterprise (64 bit) and Windows Server 2012 (64 bit), .Net Framework is 4.5 and DexExpress controls version is 5.7.1. Moreover I have attached an animated Gif for the required steps.
Please let me know about your environment settings (OS, .Net Framework etc) + any project code change (if you made).
Regards
Hi Shahab,
Thank you for the screencast. I have successfully reproduced the issue and passed this ticket to our developers for further research. Please stay tuned. We will notify you as soon as we make any progress.