[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.
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.
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.