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

Object reference not set to an instance of an object. When i close SfDialog that contains SfPivotView

i got this error:


[2022-11-16T21:46:00.102Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.

   at Syncfusion.Blazor.PivotView.Internal.GridRenderer`1.OnParametersSetAsync()

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

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


when i close:



<SfDialog Width="95%" Height="120%" Target="#target2" AllowDragging="true" IsModal="true" ShowCloseIcon="true" @bind-Visible="@dialogVisible2">

                <DialogTemplates>

                    <Header>

                        @header_label

                        <br />

                        @date_label

                    </Header>

                    <Content>

                        <div class="form-title"><span>Analisis de Combustible</span></div>

                        <div id="formId" class="form-horizontal">

                            <CascadingValue Value="@tiempos">

                                <CascadingValue Value="@PieRenderingData">

                                    <CascadingValue Value="@totales">

                                        <CascadingValue Value="@puntos">

                                            <CascadingValue Value="@lineas">

                                                <GraficaComponent OnDialogClose="OnDialogCloseHandler"></GraficaComponent>

                                            </CascadingValue>

                                        </CascadingValue>

                                    </CascadingValue>

                                </CascadingValue>

                            </CascadingValue>

                        </div>

                    </Content>

                </DialogTemplates>

                <DialogAnimationSettings Effect="animationEffect"></DialogAnimationSettings>

                <DialogEvents Opened="OnOpen" Closed="OnClose"></DialogEvents>

                <DialogPositionData X="center" Y="center"></DialogPositionData>

            </SfDialog>




this is GraficaComponent:



<DashboardLayoutPanel Column="0" Row="5" SizeX="10" SizeY="3">

                    <HeaderTemplate>

                        <span class="title">Tabla de consumos</span>

                    </HeaderTemplate>

                    <ContentTemplate>

                        <div class="container-fluid">

                            <div class="row">

                                <div class="btn-group" role="group" aria-label="Basic example">

                                    <SfDropDownList class="btn btn-secondary" TValue="string" TItem="DropDownData" @bind-Value="@SelectedMode" DataSource="@ExportMode" Width="160">

                                        <DropDownListFieldSettings Text="Name" Value="Value"></DropDownListFieldSettings>

                                    </SfDropDownList>

                                    <SfButton CssClass="e-primary" OnClick="@On" IsPrimary="true">Exportar</SfButton>

                                    <SfButton CssClass="apply-button" OnClick="@OnClick">Filtros</SfButton>

                                    <SfButton CssClass="reset-button" OnClick="@OnResetClick">Borrar Filtro</SfButton>

                                    <SfButton CssClass="update-button" Disabled="@regresar" OnClick="@((args) => Update())">Regresar</SfButton>

                                </div>

                            </div>

                        </div>

                        <SfPivotView TValue="MegaPunto" Height="720px" @ref="Pivot" EnableVirtualization="false" AllowConditionalFormatting=true AllowPdfExport="true" AllowExcelExport="true" AllowDrillThrough="true" ShowFieldList="true" EnableValueSorting=true ShowTooltip=true>

                            <PivotViewDataSourceSettings DataSource="@puntos" ShowColumnGrandTotals="false" ExpandAll=false EnableSorting=true ShowHeaderWhenEmpty=false>

                                <PivotViewColumns>

                                    <PivotViewColumn Name="Tipo"></PivotViewColumn>

                                </PivotViewColumns>

                                <PivotViewRows>

                                    <PivotViewRow Name="Index"></PivotViewRow>

                                    <PivotViewRow Name="Inicio"></PivotViewRow>

                                </PivotViewRows>

                                <PivotViewValues>

                                    <PivotViewValue Name="Kilometraje" Caption="Km"></PivotViewValue>

                                    <PivotViewValue Name="Total_inicio" Caption="Inicial (L)"></PivotViewValue>

                                    <PivotViewValue Name="Total_final" Caption="Final (L)"></PivotViewValue>

                                    <PivotViewValue Name="Consumo" Caption="Consumo (L)"></PivotViewValue>

                                    <PivotViewValue Name="Carga_final" Caption="Carga (L)"></PivotViewValue>

                                    <PivotViewValue Name="Rendimiento" Caption="Rendimiento Km/L"></PivotViewValue>

                                </PivotViewValues>

                                <PivotViewFormatSettings>

                                    <PivotViewFormatSetting Name="Odometro_inicial" Format="#,###.00 'Km'" UseGrouping="true"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Odometro_final" Format="#,###.00 'Km'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Kilometraje" Format="#,###.00 'Km'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Tanque1_inicial" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Tanque2_inicial" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Tanque3_inicial" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Tanque4_inicial" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>


                                    <PivotViewFormatSetting Name="Tanque1_final" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Tanque2_final" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Tanque3_final" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Tanque4_final" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>


                                    <PivotViewFormatSetting Name="Total_inicio" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Total_final" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Consumo" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Carga_final" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="Rendimiento" Format="#,###.00 'Km/L'" UseGrouping="false"></PivotViewFormatSetting>


                                    <PivotViewFormatSetting Name="CAN_Kilometraje_inicio" Format="#,###.00 'Km'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="CAN_Kilometraje_final" Format="#,###.00 'Km'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="CAN_Kilometraje" Format="#,###.00 'Km'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="CAN_Combustible_inicio" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="CAN_Combustible_final" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="CAN_Consumo" Format="#,###.00 'L'" UseGrouping="false"></PivotViewFormatSetting>

                                    <PivotViewFormatSetting Name="CAN_Rendimiento" Format="#,###.00 'Km/L'" UseGrouping="false"></PivotViewFormatSetting>

                                </PivotViewFormatSettings>


                                <PivotViewConditionalFormatSettings>

                                    <PivotViewConditionalFormatSetting Measure="Consumo" Conditions="Condition.GreaterThan" Value1=20>

                                        <PivotViewStyle BackgroundColor="#F39898" Color="white" FontFamily="Tahoma" FontSize="12px">

                                        </PivotViewStyle>

                                    </PivotViewConditionalFormatSetting>

                                    <PivotViewConditionalFormatSetting Measure="Consumo" Conditions="Condition.LessThan" Value1=-20>

                                        <PivotViewStyle BackgroundColor="#35bd2e" Color="white" FontFamily="Tahoma" FontSize="12px">

                                        </PivotViewStyle>

                                    </PivotViewConditionalFormatSetting>

                                </PivotViewConditionalFormatSettings>

                            </PivotViewDataSourceSettings>

                            <PivotViewGridSettings ColumnWidth=110 AllowSelection="true" AutoFit="true" AllowTextWrap="false">

                                <PivotViewSelectionSettings Type=PivotTableSelectionType.Multiple></PivotViewSelectionSettings>

                            </PivotViewGridSettings>

                            <PivotViewEvents TValue="MegaPunto" DrillThrough="drillThrough"></PivotViewEvents>

                        </SfPivotView>

                    </ContentTemplate>

                </DashboardLayoutPanel>


1 Reply

RG Rajeshkannah G Syncfusion Team November 17, 2022 08:31 AM

We are unable to reproduce the reported problem at our end with latest version 20.3.0.57. Meanwhile, we have prepared a sample and video for your reference.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Pivot_Table1522401929


Video: https://www.syncfusion.com/downloads/support/directtrac/general/ze/PivotVideo-395869657 


If the problem persists, please reproduce it in the provided sample project and revert to us (or) send your sample project that replicates the problem. This would allow us to investigate the reported problem at our end and provide a solution as soon as possible. 



Loader.
Live Chat Icon For mobile
Up arrow icon