I tried to follow the documentation to add a grid to an existing client-side blazor app and it hangs upon clicking on a column to sort or using grouping:
blazor.webassembly.js:1 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) <0x47c7e88 + 0x00130> in <0bc99a9066a34f75a4c7072f889d75eb>:0
at System.Linq.Expressions.Expression.Call (System.Type type, System.String methodName, System.Type[] typeArguments, System.Linq.Expressions.Expression[] arguments) <0x47c7b98 + 0x0004a> in <0bc99a9066a34f75a4c7072f889d75eb>:0
at Syncfusion.EJ2.Blazor.QueryableExtensions.OrderBy (System.Linq.IQueryable source, System.String propertyName, System.Type sourceType) <0x4805988 + 0x000ba> in :0
at Syncfusion.EJ2.Blazor.EnumerableOperation.PerformSorting (System.Collections.IEnumerable dataSource, System.Collections.Generic.List`1[T] sortedColumns) <0x48053f0 + 0x00092> in :0
at Syncfusion.EJ2.Blazor.EnumerableOperation.PerformSorting (System.Collections.IEnumerable dataSource, System.Collections.Generic.List`1[T] sortedColumns) <0x47fde60 + 0x00144> in :0
at Syncfusion.EJ2.Blazor.DataOperations.PerformSorting (System.Collections.IEnumerable dataSource, System.Collections.Generic.List`1[T] sortedColumns) <0x47fd978 + 0x00008> in :0
at Syncfusion.EJ2.Blazor.BaseComponent.DataProcess (System.String dataManager, System.String key) <0x4215468 + 0x001dc> in :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) <0x287aa58 + 0x000d2> in <18beac3cfc5e45a1a5ba43a33c033ac7>:0
in the razor page:
... other cols ...
@code {
public List OrderDtos { get; set; }
protected override async Task OnInitializedAsync()
{
var response = await Http.GetJsonAsync
("api/order"); OrderDtos = JsonConvert.DeserializeObject>(response.Result.ToString());
}
}