xaf

Missing Member Name ( xaf CriteriaOperator)


I get the following error when I set the View Collection Source

My simplified code us

public partial class FilterProductListViewController : ObjectViewController<ListView, .Product>
{
    public FilterProductListViewController()
    {
    }
    protected override void OnActivated()
    {
        base.OnActivated();
        CriteriaOperator op = CriteriaOperator.Parse("[WeBuyThis]")
        View.CollectionSource.Criteria["FilterProduct"] = op;  // errors here
    }
}

System.MissingMemberException HResult=0x8013151A Message=MissingMember_Name Source=DevExpress.Data.v21.2 StackTrace: at DevExpress.Data.Linq.Helpers.CriteriaToExpressionConverterInternal.MakePropertyAccess(Expression expression, String propertyName) at DevExpress.Data.Linq.Helpers.CriteriaToExpressionConverterInternal.VisitInternal(OperandProperty theOperand) at DevExpress.Data.Linq.Helpers.CriteriaToExpressionConverterInternal.Visit(OperandProperty theOperand) at DevExpress.Data.Filtering.OperandProperty.Accept[T](ICriteriaVisitor1 visitor) at DevExpress.Data.Linq.Helpers.CriteriaToExpressionConverterInternal.Process(CriteriaOperator op) at DevExpress.Data.Linq.Helpers.CriteriaToExpressionConverterInternal.VisitInternal(BinaryOperator theOperator) at DevExpress.Data.Linq.Helpers.CriteriaToExpressionConverterInternal.Visit(BinaryOperator theOperator) at DevExpress.Data.Filtering.BinaryOperator.Accept[T](ICriteriaVisitor1 visitor) at DevExpress.Data.Linq.Helpers.CriteriaToExpressionConverterInternal.Process(CriteriaOperator op) at DevExpress.Data.Linq.CriteriaToEFExpressionConverter.Convert(ParameterExpression thisExpression, CriteriaOperator op) at DevExpress.Data.Linq.Helpers.CriteriaToQueryableExtender.AppendWhere(IQueryable src, ICriteriaToExpressionConverter converter, CriteriaOperator op) at DevExpress.ExpressApp.EFCore.EFCoreObjectSpace.GetObjectsQuery(CriteriaOperator criteria, IList`1 sorting, Type objectType) at DevExpress.ExpressApp.EFCore.EFCoreCollection.Init() at DevExpress.ExpressApp.EFCore.EFCoreCollection.get_InnerList() at DevExpress.ExpressApp.EFCore.EFCoreCollection.get_Count() at DevExpress.ExpressApp.ProxyCollection.get_Count() in at System.Windows.Forms.CurrencyManager.SetDataSource(Object dataSource) at System.Windows.Forms.CurrencyManager..ctor(Object dataSource) at System.Windows.Forms.BindingContext.EnsureListManager(Object dataSource, String dataMember) at System.Windows.Forms.BindingContext.get_Item(Object dataSource, String dataMember) at DevExpress.Data.Platform.Compatibility.DefaultDesktop.DevExpress.Data.Platform.Compatibility.IDesktopBridge.GetListFromBindingContext(Object context, Object dataSource, String dataMember) at DevExpress.Data.Helpers.MasterDetailHelper.GetDataSourceCore(Object context, Object dataSource, String dataMember, IList existingListSource) at DevExpress.Data.Helpers.MasterDetailHelper.GetDataSource(Object context, Object dataSource, String dataMember)


Solution

  • The cause is when I have a miss-spelled the propertyname

    For example if the Product does not have a WeBuyThis property