State Persistence after drag & drop event using DataManager

Hello,

We have a scenario in where we use the TreeGrid to display hierarchial data fetched from a remote server (using a custom API adaptor in the DataManager). We also want to support drag and drop of all rows.

When a row is dropped in another location, the TreeGrid is refreshed, causing all of the rows to go back to a collapsed state. But we would like the TreeGrid to stay in the state it already was, so all of the expanded rows should stay expanded (and collpased rows should stay collapsed). Is there a way to keep expanded rows open, and only refresh rows where the drag and drop occured?

Thanks in advance!


1 Reply 1 reply marked as answer

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team June 7, 2021 01:34 PM UTC

Hi Kevin, 

Thanks for your interest in Syncfusion Components. 

Query#:- we use the TreeGrid to display hierarchial data fetched from a remote server. 
 
From your query we suspect that you need to bind Hierarchal data for Remote databinding.  We doesn’t have remote data support for Hierarchical data. For remote data binding, we need to use Self-Referential type of DataBinding(FlatData) to TreeGrid(which only supports remoteData). To bind self-reference data idMapping and parentIdMapping property is necessary to form a parent-child hierarchy. 

Refer to the documentation link:- 

While binding remote data to Tree Grid component, by default Tree Grid renders parent rows in collapsed state. If you want to render parentrows in Expanded state, we suggest you to use loadChildOnDemand property. 

Refer to the documentation Link:- 

Query#:- Is there a way to keep expanded rows open, and only refresh rows where the drag and drop occured? 

If you want to maintain the Expanded/Collapsed state on drag and drop operation, we suggest you to refer below kB link:- 

If your requirement is different from above, please get back to us with further details. 

Regards, 
Farveen sulthana T 


Marked as answer
Loader.
Up arrow icon