This occurs because when updating the expanded state using the event item, this is directly updating the specific object. Then when the process method is used inside render, this is creating a new instance of the data array when the expanded value is lost.
As in the example the process method is used inside render, this means that every time a new instance is created.
I updated the example to use the dataResult inside render and the expand and collapse are working. Still, after the process method is called for example after the grouping is changed the current expand and collapsed state will be lost.
I can suggest keeping the expanded items inside an additional array and applying the expanded value after any data operations.
As this is not a straight forward task, we have planned to update the process method, so it can apply the expanded state as well when processing the data.
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Feedback Portal
and vote to affect the priority of the items