Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
igGrid Remote sorting is not working when anonymous collection(AsQueryable) is returned.
posted

Hi,

I am facing an issue with remote sorting . Every time i do sorting i am getting the below exception.
Please help me in resolving this issue. Also please refer the below link for sample application to recreate the issue.

https://maftp.thruinc.net/Desktop/Distro/Show/0491SXOI31B 

{"Value cannot be null.\r\nParameter name: property"}


at System.Linq.Expressions.Expression.Property(Expression expression, PropertyInfo property)

at Infragistics.Web.Mvc.SortingExtensions.ApplyOrder(IQueryable source, String property, String methodName)

at Infragistics.Web.Mvc.SortingExtensions.OrderBy(IQueryable q, List`1 expressions)

at Infragistics.Web.Mvc.GridSorting.TransformDataSource(NameValueCollection queryString, IGridModel grid, IQueryable& queryable)

at Infragistics.Web.Mvc.GridModel.TransformDatasource(NameValueCollection queryString, IQueryable queryable)
at Infragistics.Web.Mvc.GridModel.DataBindInternal()
at Infragistics.Web.Mvc.GridModel.DataBind()

Thanks & Regards

Nagaraju P

Parents
  • 29417
    Offline posted

    Hello Nagaraju, 

    Thank you for your patience while I was looking into this. 

    I have noticed that you are using different version for the client scripts (version 18.2) and the MVC version (version 17.2).

    Please make sure to always use a matching MVC version as different versions of both libraries are not always compatible. 

    Grid remote operations work out of the box only for Queryable of object that contains the related column’s as properties, for example if you modify your data object as follows: 

           

     public object GetModel()
            {          
                List<Product> rows = new List<Product>();
               
                for (int i = 0; i < 10;i++)
                {
                    rows.Add(new Product() { ProductId = i, ProductName = "ProductName" + i });
                }
     
                return rows.AsQueryable();
            }

    Where Product is class:

        internal class Product
        {
            public int ProductId { get; set; }
            public string ProductName { get; set; }
        }

     Then remote operations will work as expected.

    If you want to use some other data type for the Qyeryable you would have to handle the remote operations manually ( https://www.igniteui.com/help/handling-remote-features-manually ).

     Let me know if you encounter any issues after updating your MVC version and changing the Model type as suggested.

     Regards,

    Maya Kirova

Reply Children