Hi,
I'm looking to find the most effecient way to count the number of XamGrid Data Rows when a XamGrid contains 1 more levels of GroupByRows. Right now, to achieve the ability to count with unlimited GroupBy levels, I've created a Recursive function that loops thru the rows and checks if it's a data row or groupby row. (I would have just used the record count of the ItemSource, but I need to also take filtering into account)
I just want to know if this is the most effecient way of getting the data row count from the XamGrid.
Thanks.
private int LoopThruGroupRows(RowCollection rows, int i) { for (int z = 0; z <= rows.Count; z++) { if (rows[z] != null) { if (rows[z].RowType == Infragistics.Controls.Grids.RowType.GroupByRow) { GroupByRow gRow = (GroupByRow)rows[z]; i = LoopThruGroupRows(gRow.Rows, i); } else if (rows[z].RowType == Infragistics.Controls.Grids.RowType.DataRow) { i++; } } } return i; }
Hello Jayboa,
I am just checking if you require any further assistance on the matter.