Posted 14 September 2017, 11:23 am EST
Hello,
You would need to loop through the FlexGrid rows and manually save the expand/collapse state of each row. After the FlexGrid has been refreshed you can reset this state on the group header rows. Here is the sample code for the functions which expand/collapse the group header rows:
[js]
function SaveExpandCollapse(hierGrid) {
var rows = hierGrid.rows;
for (var rowIdx = 0; rowIdx < rows.length; rowIdx++) {
rootRow = rows[rowIdx];
if (rootRow.hasChildren) {
ecarr.push(rootRow.isCollapsed);
}
}
}
function ApplyExpandCollapse(hierGrid) {
var rows = hierGrid.rows;
for (var rowIdx = 0, i = 0; rowIdx < rows.length; rowIdx++) {
rootRow = rows[rowIdx];
if (rootRow.hasChildren) {
rootRow.isCollapsed = ecarr[i];
i++;
}
}
}
[/js]
Kindly refer to the attached HTML Page which implements the same. Hope it helps.
Thanks,
Manpreet Kaur
2015/08/FlexGrid_Collapse_Expand.html