Hi,
I have 3 bands of hierarchy in my grid. I am able to expand the first level but not able to expand the second level. I want my grid to look like below:
-R1
- T1
P1
But what I see is:
- R1
+ T1
I am using the following code:
function expandAllRowsOfGrid()
{
// get the top level grid
var parentGrid = $("#igGrid").igHierarchicalGrid("rootWidget");
$(parentGrid.allRows()).each(function (index, element) {
$("#igGrid").igHierarchicalGrid("expand", element);
$(element).children().each(function (indexChild, elementChild) {
$(element).igHierarchicalGrid("expand", elementChild);
});
}
$(element).igHierarchicalGrid("expand", elementChild); throws an exception.
Can you please suggest the correct way to open the second level.
Regards
S
Hello Singh,
Thank you for posting in our community.
You can check the following sample: https://www.igniteui.com/hierarchical-grid/hgrid-api-events
The "Expand All" button handler demonstrates how to expand igHierarachicalGrid all levels.
Please let me know if you need any further assistance with this matter.
Thanks Vasya,
It works fine now.
As I mentioned I have 3 levels in the grid. There is a possibility that sometimes the last band of grid may not have any data. Currently even if it does not have any data it shows the + sign in the parent and I am able to expand the grid and see nothing in it.
Is there anyway way I can stop the parent grid from showing any + sign if there are no rows in the child band?