Show alternative text instead of "No Records to Display"

Hi,

Is there a way that we can show some other text instead of "No records to display" whilst the pivot chart is still loading? 

Thanks


4 Replies

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team February 5, 2024 09:29 AM UTC

Hi Forash,


We believe that your need is to customize the default text, 'No records to display,' in the pivot table. If so, you can accomplish this by modifying the localization text for 'EmptyRecordsMessage' in the resource files. Please refer to the screenshot below for your reference.




Output screenshot:


Meanwhile, we have prepared a sample for your reference. Please find it from the below attachment.


Also, please refer to the below document to know more about customizing the localized text in the pivot table.


Document: https://blazor.syncfusion.com/documentation/pivot-table/globalization#localization


Regards,

Angelin Faith Sheeba.


Attachment: SyncfusionBlazorApp3_f0d7b8cd.zip


FO Forash replied to AngelinFaithSheeba PaulvannanRajadurai February 5, 2024 09:40 AM UTC

Hi  Angelin Faith Sheeba,


Thanks for this. I am able to change the display text. On another note can this text be dependent on the state of the pivot table i.e. show "Loading..." when loading and show "No records to display" when there are not actually any records to display.


Also could this be changed to render something custom like a renderfragment otr 



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team February 6, 2024 01:17 PM UTC

Hi Forash,


We are validating your query at our end, and we will update the details in two business days(Feb 8, 2024).


We appreciate your patience until then.

                                                                                       

Regards,

Angelin Faith Sheeba.



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team February 8, 2024 12:40 PM UTC

Hi Forash,


Thanks for the patience. We believe that your requirement is to display “loading” text when loading the pivot table. If so, you can able to display the loading text using the CellTemplate option. Please refer the below code example.


Code example:

<SfPivotView ID="PivotView" TValue="ProductDetails" Height="500" Width="100%" EnableVirtualization="false" EnableValueSorting="true" ShowGroupingBar="true" ShowValuesButton="true" ShowTooltip="false" ShowFieldList="true">

    <PivotViewTemplates>

        <CellTemplate>

            @{

                var data = (context as AxisSet);

                if (data != null)

                {

                    if (isInitialLoad && !string.IsNullOrEmpty(data?.FormattedText) && data.Axis == null && data.ColumnHeaders == null && data.RowHeaders == null && data.Type == null)

                    {

                        @("Loading...")

                    }

                    else

                    {

                        @data.FormattedText

                    }

                }

            }

        </CellTemplate>

    </PivotViewTemplates>

</SfPivotView>


Output screenshot:


Meanwhile, we have prepared a sample for your reference. Please find it from the below attachment.


Also, Please refer to the below UG documentation to know more about the “CellTemplate” option.


Document: https://blazor.syncfusion.com/documentation/pivot-table/row-and-column#cell-template


Regards,

Angelin Faith Sheeba.


Attachment: PivotTable_226f0af9.zip

Loader.
Up arrow icon