An unhandled exception occurred while processing the request.

Hi there , i have this error with a simple kanban from a sql server table 
My code 

<SfKanban TValue="TodoActivity" KeyField="TodoCode" DataSource="@todoactivitiesDataSource">

    <KanbanColumns>

        <KanbanColumn HeaderText="To Do" KeyField="@(new List<string>() {"Open"})"></KanbanColumn>

        <KanbanColumn HeaderText="In Progress" KeyField="@(new List<string>() {"InProgress"})"></KanbanColumn>

        <KanbanColumn HeaderText="Testing" KeyField="@(new List<string>() {"Testing"})"></KanbanColumn>

        <KanbanColumn HeaderText="Done" KeyField="@(new List<string>() {"Close"})"></KanbanColumn>

    </KanbanColumns>

    <KanbanCardSettings HeaderField="Subject" ContentField="Subject"></KanbanCardSettings>

</SfKanban>


TodoActivity todoactivitynew = new TodoActivity { };

 protected override async Task OnInitializedAsync()

 {

     // Lista delle attività

     todoactivitiesDataSource = await TodoActivityService.SGetActivities();

 }


in the interface 

// tutte le attività

Task<List<TodoActivity>> SGetActivities();


in the class that implements interface 

public async Task<List<TodoActivity>> SGetActivities()

{

    var todoactivities = await _context.TodoActivities

        .Include(x => x.TodoCategories)

        .Include(x => x.TodoTypes)

        .Include(x => x.TodoStatuses)

        .Include(x => x.TodoSources)

        .Include(x => x.Customers)

        .Include(x => x.Projects)

        .Include(x => x.Users)

        .OrderBy(x => x.StartTime)

        .ToListAsync();

    return todoactivities;

}


@todoactivitiesDataSource or  todoactivitiesDataSource it is the same 

I can't understand where it is wrong 


3 Replies

VJ Vinitha Jeyakumar Syncfusion Team April 17, 2024 07:11 AM UTC

Hi Francesco Pruneri,


Can you please share us with some more details about your reported issue for our better understanding,


  • Share the exact issue you are facing with Kanban.
  • Share exact issue replication steps along with video illustration.
  • Are you facing any exceptions?
  • If possible, share us with simple issue replicating runnable sample.

Regards,
Vinitha


FP Francesco Pruneri April 17, 2024 07:51 AM UTC

hi i can send you files 


An unhandled exception occurred while processing the request.

NullReferenceException: Object reference not set to an instance of an object.

Syncfusion.Blazor.Kanban.SfKanban<TValue>.DataProcess()

  • Stack 
  • Query 
  • Cookies 
  • Headers 
  • Routing
  • NullReferenceException: Object reference not set to an instance of an object.

    • Syncfusion.Blazor.Kanban.SfKanban<TValue>.DataProcess()

    • Syncfusion.Blazor.Kanban.Internal.ProcessData<TContent>.OnParametersSetAsync()

    • Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)

    • Microsoft.AspNetCore.Components.Rendering.ComponentState.NotifyCascadingValueChanged(ref ParameterViewLifetime lifetime)

    • Microsoft.AspNetCore.Components.CascadingValue<TValue>.NotifySubscribers(ref ParameterViewLifetime lifetime)

    • Microsoft.AspNetCore.Components.CascadingValue<TValue>.SetParametersAsync(ParameterView parameters)

    • Microsoft.AspNetCore.Components.Rendering.ComponentState.SupplyCombinedParameters(ParameterView directAndCascadingParameters)

    • Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterView parameters)

    • Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(ref DiffContext diffContext, int oldFrameIndex, int newFrameIndex)

    • Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(ref DiffContext diffContext, int oldStartIndex, int oldEndIndexExcl, int newStartIndex, int newEndIndexExcl)

    • Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(ref DiffContext diffContext, int oldFrameIndex, int newFrameIndex)

    • Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(ref DiffContext diffContext, int oldStartIndex, int oldEndIndexExcl, int newStartIndex, int newEndIndexExcl)

    • Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, int componentId, ArrayRange<RenderTreeFrame> oldTree, ArrayRange<RenderTreeFrame> newTree)

    • Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, out Exception renderFragmentException)

    • Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

    • Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

    • Microsoft.AspNetCore.Components.RenderTree.Renderer.AddToRenderQueue(int componentId, RenderFragment renderFragment)

    • Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged()

    • Microsoft.AspNetCore.Components.ComponentBase.CallOnParametersSetAsync()

    • Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()

    • Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

    • Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

    • Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.WaitForResultReady(bool waitForQuiescence, PrerenderedComponentHtmlContent result)

    • Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.RenderEndpointComponent(HttpContext httpContext, Type rootComponentType, ParameterView parameters, bool waitForQuiescence)

    • System.Threading.Tasks.ValueTask<TResult>.get_Result()

    • Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context)

    • Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context)

    • Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext+<>c+<<InvokeAsync>b__10_0>d.MoveNext()

    • Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)

    • Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)


  • System.NullReferenceException: Object reference not set to an instance of an object.
       at Syncfusion.Blazor.Kanban.SfKanban`1.DataProcess()
       at Syncfusion.Blazor.Kanban.Internal.ProcessData`1.OnParametersSetAsync()
       at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
       at Microsoft.AspNetCore.Components.Rendering.ComponentState.NotifyCascadingValueChanged(ParameterViewLifetime& lifetime)
       at Microsoft.AspNetCore.Components.CascadingValue`1.NotifySubscribers(ParameterViewLifetime& lifetime)
       at Microsoft.AspNetCore.Components.CascadingValue`1.SetParametersAsync(ParameterView parameters)
       at Microsoft.AspNetCore.Components.Rendering.ComponentState.SupplyCombinedParameters(ParameterView directAndCascadingParameters)
    --- End of stack trace from previous location ---
       at Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterView parameters)
       at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
       at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
       at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
       at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
       at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree)
       at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
       at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
    --- End of stack trace from previous location ---
       at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
       at Microsoft.AspNetCore.Components.RenderTree.Renderer.AddToRenderQueue(Int32 componentId, RenderFragment renderFragment)
       at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged()
       at Microsoft.AspNetCore.Components.ComponentBase.CallOnParametersSetAsync()
       at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
       at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
       at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
       at Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.WaitForResultReady(Boolean waitForQuiescence, PrerenderedComponentHtmlContent result)
       at Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.RenderEndpointComponent(HttpContext httpContext, Type rootComponentType, ParameterView parameters, Boolean waitForQuiescence)
       at Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context)
       at Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context)
       at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.<<InvokeAsync>b__10_0>d.MoveNext()
    --- End of stack trace from previous location ---
       at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
       at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

No query string data.

VariableValue
.AspNetCore.Antiforgery.HQLn7gSSQmQCfDJ8Joie-ICmnhBvtP8dzo8tvNE7ov1Plkbcpz_J39DggIsM_uLnOIep4OOpkKm49H__8DePJrNmZRF4u8vOCb9GlyQPeI0B3s4xR-CzoTZClWxIYnS-m_UJ6oavbHyYmonJk6szedHtcUF2RYcHjqn61Y
VariableValue
Accepttext/html; blazor-enhanced-nav=on
Accept-Encodinggzip, deflate, br, zstd
Accept-Languageit-IT,it;q=0.9,en-US;q=0.8,en;q=0.7
Cookie.AspNetCore.Antiforgery.HQLn7gSSQmQ=CfDJ8Joie-ICmnhBvtP8dzo8tvNE7ov1Plkbcpz_J39DggIsM_uLnOIep4OOpkKm49H__8DePJrNmZRF4u8vOCb9GlyQPeI0B3s4xR-CzoTZClWxIYnS-m_UJ6oavbHyYmonJk6szedHtcUF2RYcHjqn61Y
Hostlocalhost:7277
Refererhttps://localhost:7277/todomanagement
sec-ch-ua"Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"
sec-ch-ua-mobile?0
sec-ch-ua-platform"Windows"
sec-fetch-destempty
sec-fetch-modeno-cors
sec-fetch-sitesame-origin
User-AgentMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36

Endpoint

NameValue
Display Name/todomanagement (/todomanagement)
Route Pattern/todomanagement
Route Order0
Route HTTP MethodGET, POST

Route Values

No route values.



VJ Vinitha Jeyakumar Syncfusion Team June 18, 2024 07:20 AM UTC

Hi Francesco Pruneri,


We suspect that the reported issue may occurred due to the missing of data or null values in the data bonded to the Kanban board. So please make sure to avoid null values in the data source added to the Kanban to avoid such exceptions. 

If still issue persists, share us with issue replicating simple runnable sample to validate further.

Regards,
Vinitha

Loader.
Up arrow icon