Bug Report T680096
Visible to All Users

WinForms - An XAF application crashes when an invalid user List View filter is restored

created 6 years ago (modified 6 years ago)

[DevExpress Support Team: CLONED FROM T622505: Graceful way to handle bad user diff models]

A WinForms XAF application crashes with the following callstack when restoring the user filter by a reference class column if that class no longer exists

Parser error at line 0, character 12: Can't restore user object. Tag 'XpoObject', data 'T622505.Module.BusinessObjects.TestTwo({649170aa-11f3-4203-be13-e9b678c1e08c})', Exception: 'DevExpress.Xpo.Exceptions.CannotResolveClassInfoException: Cannot resolve ClassInfo for type '[]T622505.Module.BusinessObjects.TestTwo'.
   at DevExpress.Xpo.Metadata.XPDictionary.GetClassInfo(String assemblyName, String className)
   at DevExpress.Xpo.Session.GetClassInfo(String assemblyName, String className)
   at DevExpress.Xpo.XpoObjectInCriteriaProcessingHelper.CriteriaOperator_UserValueParse_Core(UserValueProcessingEventArgs e)
   at DevExpress.Xpo.XpoObjectInCriteriaProcessingHelper.CriteriaOperator_UserValueParse(Object sender, UserValueProcessingEventArgs e)
   at DevExpress.Data.Filtering.CriteriaOperator.DoUserValueParse(String tag, String data)
   at DevExpress.Data.Filtering.Helpers.CriteriaLexer.ExtractUserValue(String tag, String data)
   at DevExpress.Data.Filtering.Helpers.CriteriaLexer.DoUserObject()'; ("[Detail!] = {FAILED HERE}##XpoObject#T622505.Module.BusinessObjects.TestTwo({649170aa-11f3-4203-be13-e9b678c1e08c})#")

at DevExpress.Data.Filtering.Helpers.CriteriaParser.Parse(String query, Boolean allowSort)
   at DevExpress.Data.Filtering.Helpers.CriteriaParser.Parse(String stringCriteria, OperandValue[]& criteriaParametersList)
   at DevExpress.Data.Filtering.CriteriaOperator.Parse(String criteria, Object[] parameters)
   at DevExpress.Xpo.XpoObjectInCriteriaProcessingHelper.ParseCriteria(Session session, String stringCriteria, Object[] parameters)
   at DevExpress.ExpressApp.Xpo.XPObjectSpace.ParseCriteria(String criteria)
   at DevExpress.ExpressApp.Win.Editors.ObjectSpaceCriteriaOperatorParser.Parse(String criteriaString)
   at DevExpress.ExpressApp.Win.Editors.XafColumnViewActiveFilterStringAdapter.SetActiveFilterCriteria(ColumnView columnView, String activeFilterString, ICriteriaOperatorParser criteriaOperatorParser)
   at DevExpress.ExpressApp.Win.Editors.XafColumnViewActiveFilterStringAdapter.TryApplyActiveFilterStringToGridView()
   at DevExpress.ExpressApp.Win.Editors.XafColumnViewActiveFilterStringAdapter.gridControlDataSourceManager_ControlDataSourceChanging(Object sender, EventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at DevExpress.ExpressApp.Win.Editors.XafGridControlDataSourceAdapter.OnControlDataSourceChanging()
   at DevExpress.ExpressApp.Win.Editors.XafGridControlDataSourceAdapter.AssignDataSourceToGridControl(Object dataSource)
   at DevExpress.ExpressApp.Win.Editors.XafGridControlDataSourceAdapter.TryAssignDataSourceToGridControl()
   at DevExpress.ExpressApp.Win.Editors.XafGridControlDataSourceAdapter.grid_HandleCreated(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnHandleCreated(EventArgs e)
   at DevExpress.XtraEditors.Container.EditorContainer.OnHandleCreated(EventArgs e)
   at DevExpress.XtraGrid.GridControl.OnHandleCreated(EventArgs e)
   at System.Windows.Forms.Control.WmCreate(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at DevExpress.XtraEditors.Container.EditorContainer.WndProc(Message& m)
   at DevExpress.XtraGrid.GridControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Please see the attached screencast and project.

Comments (2)
AG AG
Alex Gn (DevExpress) 6 years ago

    Hello Willem,

    Thank you for pointing out this issue. We researched this situation and came to the conclusion that applications should display a user-friendly exception in this scenario. We are going to add corresponding changes to our code, and I want to make sure that this solution meets your requirements. Let me know if a user-friendly exception is not appropriate in a particular scenario and describe this scenario in detail.

    W W
    Willem de Vries 6 years ago

      Hi Alex,

      Thanks for researching this issue. I'm not sure whether a user-friendly exception is appropriate, assuming that it will stop the process of starting to display the listview. I would prefer a solution that shows a message telling that an illegal filter condition is found and ignored and that the listview will be shown without an active filter.

      Answers approved by DevExpress Support

      created 6 years ago (modified 6 years ago)

      We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

      Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.