Hello Infragistics Team,
We are using the React Hierarchical Grid component (v18.7.7 URL) in our project and need to programmatically expand or collapse rows.
We attempted to use hierarchicalGridRef.current.expandRow(value), but it only expands the first row(parent row) and not its child rows. We want to expand the child row also.
Could you provide an example with code demonstrating how to expand/collapse all rows, including child rows?
Thanks in advance!
Correct, please don't use this but instead use the gridCreated event.
<IgrRowIsland
Hello Michael,
Please confirm using this approach this.hierarchicalGrid1.actualChildLayoutList[0].expandAll(); will degrade the grid performance?As earlier mentioned by you it is not recommendable.
I responded with another update to use the gridCreated event and expand the parent records by ID.
this.hierarchicalGrid1.actualChildLayoutList[0].expandAll();
This collection is supposed to be internal and not public.
Thank you for your response and for looking into our issue.
We have implemented the code changes you suggested, and it is working fine. However, we have noticed a performance degradation, even with small datasets.
In your previous comment, you mentioned:"Okay, this in fact works, but keep in mind expanding all parent rows at once can be pretty costly, and not advisable if it can be avoided."
Could you please elaborate on why this approach is not advisable? We have a feature that relies on expand/collapse functionality.
Is there an alternative approach that would maintain grid performance without causing degradation?
Looking forward to your insights.
It's more performant to hook the gridCreated event in markup inside the RowIsland(s) and the approach above is not the intended approach to do this.
eg.