We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid sort broken

Hi,

Sorting in the Grid used to work but now hangs, with the following error:
I am binding an array of anonymous objects with string and double? data types, which worked and sorted in a previous versions.

Uncaught (in promise) Error: System.InvalidOperationException: No generic method 'OrderBy' on type 'System.Linq.Queryable' 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 (System.Type type, System.String methodName, System.Type[] typeArgs, System.Linq.Expressions.Expression[] args, System.Reflection.BindingFlags flags) <0x3e78280 + 0x00130> in <19e8a6f63ed04a5393674fa6e8672456>:0 
  at System.Linq.Expressions.Expression.Call (System.Type type, System.String methodName, System.Type[] typeArguments, System.Linq.Expressions.Expression[] arguments) <0x3e6dca8 + 0x0004a> in <19e8a6f63ed04a5393674fa6e8672456>:0 
  at Syncfusion.EJ2.RazorComponents.QueryableExtensions.OrderBy (System.Linq.IQueryable source, System.String propertyName, System.Type sourceType) <0x3ea2b90 + 0x000ba> in <87489e25e0be49ee9ba9f39747d3dbfc>:0 
  at Syncfusion.EJ2.RazorComponents.EnumerableOperation.PerformSorting (System.Collections.IEnumerable dataSource, System.Collections.Generic.List`1[T] sortedColumns) <0x3ea2630 + 0x0009e> in <87489e25e0be49ee9ba9f39747d3dbfc>:0 
  at Syncfusion.EJ2.RazorComponents.EnumerableOperation.PerformSorting (System.Collections.IEnumerable dataSource, System.Collections.Generic.List`1[T] sortedColumns) <0x3e9f380 + 0x0013a> in <87489e25e0be49ee9ba9f39747d3dbfc>:0 
  at Syncfusion.EJ2.RazorComponents.DataOperations.PerformSorting (System.Collections.IEnumerable dataSource, System.Collections.Generic.List`1[T] sortedColumns) <0x3e9ee18 + 0x00008> in <87489e25e0be49ee9ba9f39747d3dbfc>:0 
  at Syncfusion.EJ2.RazorComponents.BaseComponent.DataProcess (System.String dataManager) <0x3a0c0e8 + 0x00184> in <87489e25e0be49ee9ba9f39747d3dbfc>:0 
  at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x2627d20 + 0x000d2> in <a0403c3b845f4ed592723baa5312c429>:0 
--- End of stack trace from previous location where exception was thrown ---



3 Replies

RN Rahul Narayanasamy Syncfusion Team June 28, 2019 01:09 PM UTC

Hi John, 
 
Greetings from Syncfusion. 
 
Query: Sorting in the Grid used to work but now hangs, with the following error: I am binding an array of anonymous objects with string and double? data types, which worked and sorted in a previous versions. 
 
We have checked the reported issue at our end by creating the sample and binding an array of anonymous objects as Grid datasource. In that sample we have referred the latest NuGet version(17.1.0.53-beta) and latest CDN links for script and CSS . Please find the below code example and sample for your reference. 
 
[code example] 
@page "/" 
@using Syncfusion.EJ2.RazorComponents.Grids 
 
<EjsGrid id="Grid" DataSource="@gridData" Height="100%" AllowPaging="true" AllowSorting="true"> 
    <GridPageSettings PageSize="5"></GridPageSettings> 
    <GridColumns> 
        <GridColumn Field="OrderID" HeaderText="Order ID" IsPrimaryKey="true" TextAlign="@TextAlign.Right" Width="120"></GridColumn> 
        ... 
   </GridColumns> 
</EjsGrid> 
 
 
@functions { 
    public object gridData { get; set; } 
    protected override void OnInit() 
    { 
        gridData = OrdersDetails.GetAllRecordsone(); 
    } 
} 
... 
 
namespace WebApplication1 
{ 
    public class OrdersDetails 
    { 
        ... 
 
       public static object GetAllRecordsone() 
        { 
            var order = new[] { 
                new { OrderID = "10249", CustomerID = "ALFKI", OrderDate = new DateTime(1991, 02, 04), Freight = 11.22, ShipCountry = "Berlin" }, 
                new { OrderID = "10250", CustomerID = "BOLID", OrderDate = new DateTime(1996, 02, 04), Freight = 33.22, ShipCountry = "News" }, 
                new { OrderID = "10260", CustomerID = "NOMID", OrderDate = new DateTime(1990, 02, 04), Freight = 22.22, ShipCountry = "ASDA" } 
            }.ToList(); 
            return order; 
        } 
        ... 
 
} 
 
[styles and scripts] 
    <environment include="Development"> 
        <link rel="stylesheet" rel='nofollow' href="css/bootstrap/bootstrap.min.css" /> 
        <link rel='nofollow' href="https://cdn.syncfusion.com/ej2/material.css" rel="stylesheet" /> 
        <script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script> 
        <script src="https://cdn.syncfusion.com/ej2/dist/ejs.interop.min.js"></script> 
    </environment> 
 
 
 
Also we suspect that the reported issue is not a Grid component issue. [Blazor] IL Linker not working properly, it may be the cause of an issue.   
 
We suggest you to disable the IL Linker which is present in your .csproj file. Please refer the following code snippet.  
 
<PropertyGroup>  
    <TargetFramework>netstandard2.0</TargetFramework>  
    .  .  .  .  
    <BlazorLinkOnBuild>false</BlazorLinkOnBuild>  
      
  </PropertyGroup>  

Please refer the following link for more information: https://github.com/mono/mono/issues/12917    
 
If you are still facing the same problem, could you please share the below details. It will be helpful to provide a better solution. 
 
  • Share Essential Studio JS2 version details(in which version it works & in which version it does not work).
  • Share full grid code example if possible.
 
Regards, 
Rahul 



JO John June 28, 2019 07:01 PM UTC

Thanks for the workaround.  I can confirm it works.  I trust you will report this problem to Microsoft.




RN Rahul Narayanasamy Syncfusion Team July 1, 2019 01:12 PM UTC

Hi John, 
 
Query: Thanks for the workaround.  I can confirm it works.  I trust you will report this problem to Microsoft. 
 
Thanks for your update. 
 
Microsoft has already documented about this topic. Please find the below link for more information. 
 

Please get back to us if you need further assistance. 

Regards, 
Rahul 


Loader.
Live Chat Icon For mobile
Up arrow icon