Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
XamGrid Record count with GroupByRows
posted

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 rowsint i)
        {
            for (int z = 0z <= rows.Countz++)
            {
                if (rows[z!= null)
                {
                    if (rows[z].RowType == Infragistics.Controls.Grids.RowType.GroupByRow)
                    {
                        GroupByRow gRow = (GroupByRow)rows[z];
                        i = LoopThruGroupRows(gRow.Rowsi);
                    }
                    else if (rows[z].RowType == Infragistics.Controls.Grids.RowType.DataRow)
                    {
                        i++;
                    }
                }
            }
 
            return i;
        }
Parents
No Data
Reply Children
No Data