Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.29k stars 533 forks source link

Datagrid random error on sort #2254

Closed mortezabarzkar closed 3 years ago

mortezabarzkar commented 3 years ago

some time on refreshing page whit huge amount of data i got this error

 Unhandled exception rendering component: Failed to compare two elements in the array.

System.InvalidOperationException: Failed to compare two elements in the array.

 ---> System.ArgumentException: At least one object must implement IComparable.

   at System.Collections.Comparer.Compare(Object a, Object b)

   at System.Collections.Generic.ObjectComparer`1.Compare(T x, T y)

   at System.Linq.EnumerableSorter`2.CompareAnyKeys(Int32 index1, Int32 index2)

   at System.Collections.Generic.ArraySortHelper`1.SwapIfGreater(Span`1 keys, Comparison`1 comparer, Int32 i, Int32 j)

   at System.Collections.Generic.ArraySortHelper`1.IntroSort(Span`1 keys, Int32 depthLimit, Comparison`1 comparer)

   at System.Collections.Generic.ArraySortHelper`1.IntrospectiveSort(Span`1 keys, Comparison`1 comparer)

   at System.Collections.Generic.ArraySortHelper`1.Sort(Span`1 keys, Comparison`1 comparer)

   --- End of inner exception stack trace ---

   at System.Collections.Generic.ArraySortHelper`1.Sort(Span`1 keys, Comparison`1 comparer)

   at System.MemoryExtensions.Sort[T](Span`1 span, Comparison`1 comparison)

   at System.Linq.EnumerableSorter`2.QuickSort(Int32[] keys, Int32 lo, Int32 hi)

   at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)

   at System.Linq.OrderedEnumerable`1.GetEnumerator()+MoveNext()

   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)

   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

   at Blazorise.DataGrid.DataGrid`1.FilterData(IQueryable`1 query)

   at Blazorise.DataGrid.DataGrid`1.FilterData()

   at Blazorise.DataGrid.DataGrid`1.FilterViewData()

   at Blazorise.DataGrid.DataGrid`1.b__436_5(RenderTreeBuilder __builder4)

   at Blazorise.TableBody.BuildRenderTree(RenderTreeBuilder __builder)

   at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder)

   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)

   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)

   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
stsrki commented 3 years ago

So it is not all the time? I don't see much from the stack trace. Only that it happens on sort.

mortezabarzkar commented 3 years ago

yes it is some time

stsrki commented 3 years ago

Closing now since we're unable to reproduce it.