No generic method 'Where' on type 'System.ServiceModel.DomainServices.Client.EntityQueryable'

2 posts, 0 answers
  1. Dave K
    Dave K avatar
    5 posts
    Member since:
    May 2009

    Posted 13 Mar 2014 Link to this post

    I have a RadGridView which is bound to some data wrapped in a QueryableDomainServiceCollectionView. Inside the RadGridView are columns which are bound to both the actual field data within the QueryableDomainServiceCollectionView as well as there are some ExpressionColumns that are used to retrieve data at runtime. These ExpressionColumns are within the CodeBehind and run once when the View is loaded.

    Here is the code for one of the expressions I am trying to run for one of the expression columns (code behind):

    Expression<Func<AISPTMemberParish, int>> expression01 = member =>   member.AISPTMember.AISPTMemberDonorNumbers.Where(data => data.AISPTDonorNumberType.PTDonorNumberTypeName.ToLower().Contains("envelope")).Select(r => r.PTMemberDonorNumber).First();
     
    var column01 = this.grdDonations.Columns["EnvNo"] as GridViewExpressionColumn;
    column01.Expression = expression01;

    Here is the XAML that is for the same expression above.

    <telerik:GridViewExpressionColumn UniqueName="EnvNo"   Header="{Binding LocalizedStrings.EnvelopeNumber, Source={StaticResource LocalizedStrings}}"   IsVisible="True"/>


    These seem to work well and data shows up like it should, until the user decides to click on the column header of the column of the expression column in order to sort the data. NOTE: This happens on all the columns on the RadGridView where the column is set to an expression column and is returning the data. Regular bound columns are fine with sorting.

    PS. I am using RiaServices with my project.

    Here is the error message:

    No generic method 'Where' on type 'System.ServiceModel.DomainServices.Client.EntityQueryable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.
    at System.Linq.Expressions.Expression.FindMethod(Type type, String methodName, Type[] typeArgs, Expression[] args, BindingFlags flags) at System.Linq.Expressions.Expression.Call(Type type, String methodName, Type[] typeArguments, Expression[] arguments) at Telerik.Windows.Controls.DomainServices.EntityQueryPlaceholder`1.EntityQueryBuilder.VisitMethodCall(MethodCallExpression node) at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitArguments(IArgumentProvider nodes) at System.Linq.Expressions.ExpressionVisitor.VisitMethodCall(MethodCallExpression node) at Telerik.Windows.Controls.DomainServices.EntityQueryPlaceholder`1.EntityQueryBuilder.VisitMethodCall(MethodCallExpression node) at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitArguments(IArgumentProvider nodes) at System.Linq.Expressions.ExpressionVisitor.VisitMethodCall(MethodCallExpression node) at Telerik.Windows.Controls.DomainServices.EntityQueryPlaceholder`1.EntityQueryBuilder.VisitMethodCall(MethodCallExpression node) at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at Telerik.Windows.Controls.DomainServices.EntityQueryPlaceholder`1.EntityQueryBuilder.VisitUnary(UnaryExpression node) at System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at Telerik.Windows.Controls.DomainServices.EntityQueryPlaceholder`1.EntityQueryBuilder.VisitMethodCall(MethodCallExpression node) at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at Telerik.Windows.Controls.DomainServices.EntityQueryPlaceholder`1.EntityQueryBuilder.VisitMethodCall(MethodCallExpression node) at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at Telerik.Windows.Controls.DomainServices.EntityQueryPlaceholder`1.BuildEntityQuery(EntityQuery`1 entityQuery, Expression entityQueryableExpression) at Telerik.Windows.Data.QueryableDomainServiceCollectionView`1.BuildEntityQuery(Int32 pageIndex) at Telerik.Windows.Data.QueryableDomainServiceCollectionViewBase.LoadInternal(Boolean forceLoad, Int32 pageIndex) at Telerik.Windows.Data.QueryableDomainServiceCollectionViewBase.Load(Boolean forceLoad) at Telerik.Windows.Data.QueryableDomainServiceCollectionView`1.RequestAutoLoad() at Telerik.Windows.Data.QueryableDomainServiceCollectionView`1.OnSortDescriptorsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Telerik.Windows.Data.RadObservableCollection`1.ResumeNotifications() at Telerik.Windows.Data.CollectionHelper.Reset(IEnumerable source, IList target, Func`2 itemConverter) at Telerik.Windows.Data.CollectionHelper.Reset(IEnumerable source, IList target) at Telerik.Windows.Data.ObservableCollectionManager.HandleCollectionChanged(IList sender, NotifyCollectionChangedEventArgs args) at Telerik.Windows.Data.ObservableCollectionManager.Telerik.Windows.Data.IWeakEventListener.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args) at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Telerik.Windows.Data.RadObservableCollection`1.ResumeNotifications() at Telerik.Windows.Controls.GridView.GridViewDataControl.PerformSorting(GridViewSortingEventArgs sortingArgs) at Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClassb4.b__b3() at Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action) at Telerik.Windows.Controls.GridView.GridViewDataControl.Sort(GridViewColumn column, Boolean appendToExisting) at Telerik.Windows.Controls.GridView.GridViewHeaderCell.RequestSort(Boolean appendToExisting) at Telerik.Windows.Controls.GridView.GridViewHeaderCell.PerformUserSort() at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

    I tried to debug this and see where the error is being sprung but i cannot. Is there something I am missing? I need to be able to have the users sort on the those expression columns and I figured it was doable because your documentation states that columnexpressions can be sorted and filtered on.

    Please and thank you.

    DK.
  2. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 18 Mar 2014 Link to this post

    Hello Dave ,

    We have already answered to the other support thread you started on the same topic. You can check the tips suggested there. 

    In order to make our communication consistent, it would be better to follow a single thread on the topic.

    Thank you for the understanding.

    Regards,
    Yoan
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  3. DevCraft banner
Back to Top