Hello,
I have a Blazor Server application with a Pivot table where I am trying to update values often. If data is updated to frequently (<200ms) the loading time of the table makes the tool more or less unusable. I could limit the rate of data changes to something like 1 or 5 seconds but that still makes the tool very clunky to use. Is there a solution to a rapidly changing data source in a Pivot Table or would something like a treegrid be more appropriate for this? I would prefer to use the pivot table for its level of customization by the end user.
I should note that for my needs this table does not contain a large data set. At most it will have 4-5 rows, 5 values, and less than 10 underlying objects being mapped out.
Thank you,
Hi LeaLand,
We would like to let you know that you can use the "DataBound" event to periodically refresh the data source as per your requirement. Please refer to the code example below for reference.
Code Example:
|
<SfPivotView> <PivotViewDataSourceSettings DataSource="@Data" ></PivotViewDataSourceSettings> <PivotViewEvents TValue="PivotData" DataBound="@DataBound"></PivotViewEvents> </SfPivotView>
Code { public List<PivotData> Data { get; set; } public void DataBound() { this.Data = PivotData.GetData().ToList(); } }
|
Output Screenshot:
Meanwhile we have prepared a sample for your reference
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/PI0B8B~1-1641922007
Please let us know if you have any concerns.
With Regards,
Rajeshkannah Gopalakrishnan.
Thank you for the update. Where is the documentation for the DataBound event on a Pivot Table? I don't fully understand how this is behaving differently then just setting the data source to an Observable Collection and raising the NotifyPropertyChanged event when a property changes on the source object.
The project attached has the same issue as initially noted. Frequent updates to the underlying data and the loading time to re render the component makes the table effectively unusable.
Thank you,
Hi Leland,
We are validating this query at our end and will provide further details within two business days (Sep 9, 2022).
Regards,
Angelin Faith Sheeba
Hi Leland,
Please find the response below:
|
Query |
Comments |
|
Where is the documentation for the DataBound event on a Pivot Table |
Sorry for the inconvenience. We will update the DataBound event information in our UG documentation, and we will inform you once its refreshed in live. |
|
I don't fully understand how this is behaving differently then just setting the data source to an Observable Collection and raising the NotifyPropertyChanged event when a property changes on the source object. |
We have prepared a sample using observable collection data source based on your requirement. Please find the sample and video links below for your reference.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Pivot_Table-165737889 Video: https://www.syncfusion.com/downloads/support/directtrac/general/ze/MFESLW~1-830742793
If the problem persists, please reproduce it in the provided sample and revert to us (or) send your sample that replicates the problem. This would allow us to investigate the reported problem at our end and provide a solution as soon as possible. |
Please let us know if you have any concerns.
Regards,
Angelin Faith Sheeba.
Thank you for this. I may not have been clear about what the specific question was. Does a pivot table have to re-render the entire component when only one property is changed in the source data?
See the attached example modified from the example you provided here. I just added a loop to continuously update one records ID. Anything below 500 ms makes it almost impossible to use the table (drill down, navigate, filter ect) due to the loading time of the change.
So I guess the question would be is this tool not suitable for something with very frequent update for example stock price updates that could occur many times a second?
Hi Leland,
Yes. Pivot table renders based on the aggregated values, So, even if we change one property in the given data source, the pivot table component will re-render in order to calculate the aggregated values that to be displayed in the pivot table UI. Thus, it took time while changing the data source frequently. Therefore, any UI actions will not be executed while changing the data source frequently.
Please let us know if you have any concerns.
Regards,
Angelin Faith Sheeba.
Understood. I will either rate limit my updates or look at using a different tool.
Thank you for the clarification.
Hi Leland,
Please contact us if you have any other queries. We are always happy to assist you.
Regards,
Angelin Faith Sheeba.