From a user:
"First of all, I must say that the GuessAutoFilterRowValuesFromFilter method is not supposed to be used directly in your code. This method is created for internal use only" -> i was pointed to this method and there is also an official example for it… -> How to restore the Auto Filter Row from the ActiveFilterString, after restoring the layout
Now start the App - filter the Contact via the Position column. If you have set the Filter click 2! times the Contact item in the Navigation bar - after the second click you will see that the filter is no longer visible, and if you click into the filter column you get an invalidcastexception because the value is now an string…?"
=====
You can use the following ViewController to replicate this error with our MainDemo.Win app:
C#namespace MainDemo.Module.Win {
using System;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Win.Editors;
using DevExpress.Data.Filtering;
public class B152594 : ViewController<ListView> {
GridListEditor listEditor;
protected override void OnViewControlsCreated() {
base.OnViewControlsCreated();
listEditor = View.Editor as GridListEditor;
if(listEditor != null) {
listEditor.Grid.HandleCreated += Grid_HandleCreated;
}
}
private void Grid_HandleCreated(object sender, EventArgs args) {
listEditor.Grid.HandleCreated -= Grid_HandleCreated;
listEditor.GridView.GuessAutoFilterRowValuesFromFilter();
}
}
}
The following error will be thrown when restoring reference properties:
DevExpress.Xpo.v15.2.dll!DevExpress.Xpo.XpoObjectInCriteriaProcessingHelper.CriteriaOperator_UserValueParse_Core(DevExpress.Data.Filtering.UserValueProcessingEventArgs e) Unknown
DevExpress.Xpo.v15.2.dll!DevExpress.Xpo.XpoObjectInCriteriaProcessingHelper.CriteriaOperator_UserValueParse(object sender, DevExpress.Data.Filtering.UserValueProcessingEventArgs e) Unknown
DevExpress.Data.v15.2.dll!DevExpress.Data.Filtering.CriteriaOperator.DoUserValueParse(string tag, string data) Unknown
DevExpress.Data.v15.2.dll!DevExpress.Data.Filtering.Helpers.CriteriaLexer.ExtractUserValue(string tag = "XpoObject", string data = "MainDemo.Module.BusinessObjects.Position({7c9c8d30-7c5c-4f69-b281-a6c09088f62e})") Unknown
DevExpress.Data.v15.2.dll!DevExpress.Data.Filtering.Helpers.CriteriaLexer.DoUserObject() Unknown
DevExpress.Data.v15.2.dll!DevExpress.Data.Filtering.Helpers.CriteriaLexer.Advance() Unknown
DevExpress.Data.v15.2.dll!DevExpress.Data.Filtering.Helpers.CriteriaParser.yyparse(DevExpress.Data.Filtering.Helpers.yyInput yyLex = {DevExpress.Data.Filtering.Helpers.CriteriaLexer}) Unknown
DevExpress.Data.v15.2.dll!DevExpress.Data.Filtering.Helpers.CriteriaParser.Parse(string query = "[Position!] = ##XpoObject#MainDemo.Module.BusinessObjects.Position({7c9c8d30-7c5c-4f69-b281-a6c09088f62e})#", bool allowSort) Unknown
DevExpress.Data.v15.2.dll!DevExpress.Data.Filtering.Helpers.CriteriaParser.Parse(string stringCriteria, out DevExpress.Data.Filtering.OperandValue[] criteriaParametersList = null) Unknown
DevExpress.Data.v15.2.dll!DevExpress.Data.Filtering.CriteriaOperator.Parse(string criteria, object[] parameters = {object[0]}) Unknown
DevExpress.Data.v15.2.dll!DevExpress.Data.Filtering.CriteriaOperator.TryParse(string criteria, object[] parameters) Unknown
DevExpress.XtraGrid.v15.2.dll!DevExpress.XtraGrid.Columns.ColumnFilterInfo.ColumnFilterInfo(DevExpress.XtraGrid.Columns.ColumnFilterType type = AutoFilter, object _value = {MainDemo.Module.BusinessObjects.Position}, string filterString = "[Position!] = ##XpoObject#MainDemo.Module.BusinessObjects.Position({7c9c8d30-7c5c-4f69-b281-a6c09088f62e})#", string displayText = "") Unknown
DevExpress.XtraGrid.v15.2.dll!DevExpress.XtraGrid.Columns.ColumnFilterInfo.ColumnFilterInfo(DevExpress.XtraGrid.Columns.ColumnFilterType type = AutoFilter, object _value = {MainDemo.Module.BusinessObjects.Position}, string filterString = "[Position!] = ##XpoObject#MainDemo.Module.BusinessObjects.Position({7c9c8d30-7c5c-4f69-b281-a6c09088f62e})#") Unknown
DevExpress.XtraGrid.v15.2.dll!DevExpress.XtraGrid.Views.Grid.GridView.GuessAutoFilterRowValuesFromFilter() Unknown
Hello Noxe,
I could collect four various scenarios in which the actual behavior seemed to be inconsistent. We will research them further, and let you know our results. Please bear with us.
Thanks,
Dennis