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
Hello Parachuri,
Thank you for the provided sample.
I managed to reproduce the issue and I am researching what causes the problem. I will keep you posted on my progress and I will get back to you soon with more information or questions for you.
Meanwhile do not hesitate to contact me if you have any additional or questions.
May I know any progress on this issue.
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
Thanks for your input. But as per my requirement I do not want to use any model type. In case if I have to implement remote features manually, do I need to implement all of them or this issue exist only for sorting ,others I can still go with my existing logic. Also I dont see the ApplyOrder method in the link that you have shared. from which the exception is being thrown. Can you please help me in implementing remote sorting manually for collection of anonymous types.
Other features that depend on the columns (like filtering, groupby etc.) will also not work out of the box with Dictionary models, so if you have such features you would have to manually handle their remote operations as well.
You can refer to the following sample that manually implements remote sorting:
https://www.igniteui.com/grid/manual-remote-features-handling
It contains an ApplyOrder method that work on objects. In your case you should modify it so that it reads from your Dictionary.
Let me know if you have any questions.