How to refresh data in Pivot Table when data source changes?

Data Source of my pivot view is bound to List or ObservableCollection in my data access layer class.
When i update that list by NodeSelected event of SfTreeView NodeSelected pivot wont refresh first time or everi next time if list is empty, 
it keeps data from previous selection.
Is there a way to resolve this?

5 Replies 1 reply marked as answer

SN Sivamathi Natarajan Syncfusion Team July 29, 2020 06:41 AM UTC

Hi Igor Surla, 
 
Thanks for contacting Syncfusion support. 
 
Could you please share us your sample to replicate the same at our end? So, that we can analyze your codes at our end and provide you the solution at earliest.  
  
Regards,  
Sivamathi.  



IS Igor Surla July 29, 2020 12:49 PM UTC

Hi Sivamathi Natarajan,

In attachment you could find my razor file and other necessary classes.
By default pivot should load all data.
When user pick one off the members from tree view pivot data should reload but it does not for the first time if number of rows should be less than before, also if users select option which does not have data pivot still keeps previous data.
Let me know if you need anything else.

Thanks,
Igor Surla

Attachment: PivotAndTreeSample_61a0142e.zip


SN Sivamathi Natarajan Syncfusion Team July 30, 2020 02:11 PM UTC

 
Thanks for the sample to reproduce the issue at our end. We have modified the provided sample to make it work. Please check the below sample. 
 
 
Please let us know if you have concern. 
 
Regards, 
Sivamathi. 



IS Igor Surla July 30, 2020 03:01 PM UTC

Hi Sivamathi Natarajan,

I have removed unnecessary  code from example and reattached it.
StateHasChanged(); helped with refreshing data when there is data to show.

I still have issue when there is no data to be shown.
In order to reproduce it Select Account3 from TreView.
As you can see pivot would not refresh, it will show data from previous selection.

Can you help me with this issue also?

Thanks,
Igor Surla

Attachment: Pivot_Table_e45a7c45.zip


SN Sivamathi Natarajan Syncfusion Team July 31, 2020 12:34 PM UTC

 
If the data source is empty, you will get the empty grid view. So, kindly bind the data source before you do the operation. Please check the below sample for your reference. 
 
 
Please let us know if you have concern. 
 
Regards, 
Sivamathi. 


Marked as answer
Loader.
Up arrow icon