datasource with obsevercollection... no update based on htmlattribute template


datiDaPianificare is my ObserbableCollection

it is used as DataSource on my TreeView



in Scheduler OnActionComplete event I modify collections (Scheduler and Treview)

Scheduler update and refresh works fine but it doesn't work on Treeview


(I'm using add and remove because INotifyOnPropertyChange doesn't work on update but I have few items...fix it will be further step but now is not important)



this is my css that used in HtmlAttributes... that works well but not on update collection




3 Replies

IL Indhumathy Loganathan Syncfusion Team February 9, 2022 01:45 PM UTC

Hi Alessandro, 
 
Greetings from Syncfusion support. 
 
By using Observable Collections, objects can be added, removed, or updated with an automatic notification of actions. The ObservableCollection (dynamic data collection) provides notifications when items are added, removed, and moved. The INotifyPropertyChanged method notifies when a property value has changed on the client side. For your reference, we have attached the sample. 
 
In the sample, the UI is automatically updated when an object is added to or removed from an observable collection. To refresh the UI for a single property update, the setter of the corresponding property must be configured as shown in the below sample. 
 
 
Please check the sample to perform the operations at your end. If we have misunderstood, revert by replicating the exact issue in the shared sample. Do you have to perform TreeView operations in a Scheduler component event? Also, we are quite unclear about your query regarding HtmlAttributes. So kindly explain your exact query with a video footage which will help us to assist you promptly. 
 
Please let us know if you need any further assistance. 
 
Regards, 
Indhumathy L 



AD Alessandro Degola February 14, 2022 05:11 PM UTC

morning,


I’m a little bit sure that observercollection works fine when you add but it doesn’t work when you remove an item from the collection. 


regards

alessandro



IL Indhumathy Loganathan Syncfusion Team February 15, 2022 01:58 PM UTC

Hi Alessandro, 
 
In our previous shared sample, we removed nodes from an observable collection. By clicking on the "Delete Node" button, we have removed the selected node from the TreeView. If there is no node selected, it will remove the first position node in the TreeView component. If the object is properly removed from the observable collection, then it will be removed from the TreeView as well. To refresh the UI for a single property update, the setter of the corresponding property must be configured as shown in our shared sample. Please check our Delete operation related code from the shared sample. 
 
Have you tried the same at your end? If the issue still persists, replicate the issue in our shared sample. These details would help us assist you promptly. 
 
Regards, 
Indhumathy L 


Loader.
Up arrow icon