Assume the situation where the grid is in GroupByMode, resulting in two rows that are yet to be expanded. I am writing a loop that will go through the children nodes and perform some operations. Here is the issue that I am running into:
*** loop through the grid rows, there are only 2 ***
var rows = row.getChildRows();
alert(rows.length); <-- this alerts with the correct number of childern
var child_row = rows.getRow(0); <-- this results in "Object doesn't support this property or method"
So as I understand it I am able to get the collection of the child rows, I am able to get the lengths of the collection, however for some reason I am not able to use the getRow method on any index in that collection. The grid is not using any load on deman capability, I am able to view the rows in the source of the page. Where am I going wrong?
Thanks.
Hello,
To get the child rows you are after, you can use the getChildRow method to get the first child row and access each subsequent row from there using getNextRow. Or, you can get the entire collection by using the OwnerCollection property after getting the first child row.
Thank you, that did the trick.
I'm having a similar problem. http://forums.infragistics.com/forums/p/19996/72193.aspx#72193
dev_maniac said: I'm trying to loop through the rows of a grid. My function works fine when not grouped, but something is going awry when grouped. I'm looping through the top level grid.Rows. On each row I check if row.ChildRowsCount > 0. Which it is on the second iteration.After that I have an alert showing me row.ChildRowsCount and row.getChildRows.length. The first is 4 but the second is 0.I also tried row.getChildRow(0), which is null. Any help please?
I'm trying to loop through the rows of a grid. My function works fine when not grouped, but something is going awry when grouped.
I'm looping through the top level grid.Rows. On each row I check if row.ChildRowsCount > 0. Which it is on the second iteration.After that I have an alert showing me row.ChildRowsCount and row.getChildRows.length. The first is 4 but the second is 0.I also tried row.getChildRow(0), which is null.
Any help please?
Can you post your code? And where the code is being called?