Radzen Blazor DataGrid hierarchy

I have a RadzenDataGrid with a hierarchy template.
I use ExpandMode property set to DataGridExpandMode.Multiple
I would like that if the used adds a new record to the grid all the previously expanded rows are collapsed and only the newly inserted one remains expanded.

I didn't find the counterpart of the ExpandRow method (CollapseRow or something like that), so my question is how is it possible to collapse all rows.

I already tried to set the ExpandMode to Single just before expanding the new one and then set it back to Multiple. But it didn't work.

Any ideas?

Thank you very much in advance!

Best regards,

ExpandRow() will toggle row expand state:

Hello Mr. Enchev,
Thank you for your quick reply!

So the method toggles the state of the item. May be it is a good idea update the summary of the method to make it more obvious.

Ok, I see how should I proceed: since I already keep track of the expanded rows I will collapse them before or after adding the new item.

Thank you once again!

Best regards,