We want to Expand/Collapse All Rows (parent and child) in igHierarchicalGrid on one button click.
I have tried following code, but it only expands to first level
var parentGrid = $("#Grid").igHierarchicalGrid("rootWidget"); $(parentGrid.allRows()).each(function (index, element) { $("#Grid").igHierarchicalGrid("expand", element); });
Please help
Hello,
You can check the following sample: http://www.igniteui.com/hierarchical-grid/hgrid-api-events.The "Expand All" button handler demonstrates how to expand igHierarchicalGrid all levels.
Hope this helps,Martin PavlovInfragistics, Inc.
Thanks, this works as expected.
could not find this link yesterday, was looking at http://www.igniteui.com/help/api/2016.1/ui.igHierarchicalGrid but it didnot help.
You're welcome.
We will add a link to the sample in the igHierarchcialGrid API docs.
Best regards,Martin PavlovInfragistics, Inc.