syncfusion error: System.InvalidOperationException: Sequence contains no elements

Hi,

in my application there are three grids displayed on three different tabs.

All grid have edit mode set to Normal; when user save data all works fine.

If I change one of grid so that edit is in batch mode, when user save, got this error:


blazor.server.js:1 [2022-11-23T16:04:08.633Z] Error: System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at Syncfusion.Blazor.Grids.Internal.DataGenerator`1.<>c__DisplayClass15_0.<GroupQuery>b__0(String col)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at Syncfusion.Blazor.Grids.Internal.DataGenerator`1.GroupQuery(Query query)
   at Syncfusion.Blazor.Grids.Internal.DataGenerator`1.GenerateQuery(Boolean skipPage, Int32 VirtualStartIndex, Int32 VirtualEndIndex)
   at Syncfusion.Blazor.Grids.SfGrid`1.GenerateAndExecuteQuery(Query query, Boolean foreignKeyHandle, Boolean isForeignKeyAction, Int32 VirtualStartIndex, Int32 VirtualEndIndex, Boolean isQueryGenerated, Boolean preventForeign)
   at Syncfusion.Blazor.Grids.SfGrid`1.DataProcessChildContent(ActionArgs action, ActionEventArgs`1 actionArgs, Boolean foreignKeyHandle, Boolean isForeignKeyAction)
   at Syncfusion.Blazor.Grids.SfGrid`1.DataProcessChild(ActionArgs action, ActionEventArgs`1 actionArgs)
   at Syncfusion.Blazor.Grids.SfGrid`1.DataProcess(ActionArgs action, ActionEventArgs`1 actionArgs)
   at Syncfusion.Blazor.Grids.SfGrid`1.DataProcess(ActionArgs action, ActionEventArgs`1 actionArgs)
   at Syncfusion.Blazor.Grids.Internal.Edit`1.BatchSave()
   at Syncfusion.Blazor.Grids.Internal.Edit`1.EndEdit()
   at Syncfusion.Blazor.Grids.SfGrid`1.EndEdit()
   at Syncfusion.Blazor.Grids.SfGrid`1.EndEditAsync()
   at KSkill.Pages.EditForm.EndEditGrids() in D:\K-REV\krevsuite_pulita\K-Skill\KSkill\Pages\EditForm.razor:line 1103
   at KSkill.Pages.EditForm.SaveAll(MouseEventArgs args) in D:\K-REV\krevsuite_pulita\K-Skill\KSkill\Pages\EditForm.razor:line 1033
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Syncfusion.Blazor.Internal.SfBaseUtils.InvokeEvent[T](Object eventFn, T eventArgs)
   at Syncfusion.Blazor.Buttons.SfButton.OnClickHandler(MouseEventArgs args)
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Can you help me?

Tank you,

Elena.


1 Reply

PS Prathap Senthil Syncfusion Team November 25, 2022 12:30 PM UTC

Hi Stefano,


Greetings from Syncfusion support,


We created a sample based on the issues you mentioned. But we’re unable to replicate the reported issue at our end. Please refer the attached sample for your reference.


If the reported issue persists or we misunderstood your query, please share an issue replicating runnable sample or try to replicate the issue in the sample provided so that we can validate the reported query and provide a solution as soon as possible.



Regards,

Prathap S


Attachment: BlazorApp1_e9072078.zip

Loader.
Up arrow icon