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
335
Looping through hierarchical UltraGrid
posted

Hello,

I have a question again regarding a hierarchical dataset as datasource for my ultragrid. I have on every level a checkbox column in the header and therefore in every row. This is for checking or unchecking the row for later processing later on. Unfortunately this header checkbox is only working for the level it is on, that means if I check it, it doesn't check the child rows automatically. Thus I manually programmed this functionality but it has bad performance for a higher amount of datarows. I my current test example I have 1500 rows on the first level and multiple bands which are holding lots of childrows, one of em even about 8000-12000 rows. I also need to set a headercheckbox to indeterminate if at least one datarow in the lower childlevels is not checked. And here is my problem, because therefore I have to iterate through ALL rows and have to look if it is checked. Currently I'm doing this with the example code of this:

http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.1~Infragistics.Win.UltraWinGrid.UltraGridRow~ChildBands.html

That takes in my example (I have single core 64bit, 2ghz, 32bit winxp, 2gb ram) almost one minute.

my question is, do you think this is normal with that mass of datarows or do you have any idea too make things differently?

here is my part of code:

    Protected Function IsEveryRowChecked(ByVal Rows As RowsCollection) As Boolean

        For Each Row As UltraGridRow In Rows
            If DirectCast(Row.Cells("check").Value, Boolean) Then
                If Not Row.ChildBands Is Nothing Then
                    For Each ChildsChildBand As UltraGridChildBand In Row.ChildBands
                        If Not IsEveryRowChecked(ChildsChildBand.Rows) Then
                            Return False
                        End If
                    Next
                End If
            Else
                Return False
            End If
        Next
        Return True


    End Function

 

Greetings,

Renelope