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
15
Get Child Band Row Count from SwfTable
posted

I am using UFT One 2023.

I am able to capture the Row Count of the Parent (Level 1) rows.  However, some of the rows have Child (Level 2) rows and I'm having issues capturing the count of these particular rows.

I keep reading articles about using GetNAProperty (and that seems to be working for many people).  However, this method is not available in UFT.  The closest method I could find was GetROProperty. However, that doesn't seem to be returning the correct count -- it keeps returning ' 1 '.

Here is my code:

'First I select a row

SwfWindow("Portfolio Rebalancing").SwfTable("grdEAA").SelectRow(0)

'Then I attempt to get the row count of any child bands:

childBandsCount = SwfWindow("Portfolio Rebalancing").SwfTable("grdEAA").GetROProperty("ActiveRow.ChildBands.Count")

(This always returns '1' whether there are child rows or not)

Here is an example of my table. The highlighted BLUE rows are the Parent Rows.  As can be seen, in some instances there are child rows associated with the Parent rows and in other cases there is not).  I just need to select each Parent Row and then determine and/or get the row count of any potential Child Rows

Parents
No Data
Reply
  • 29105
    Suggested Answer
    Offline posted

    Hello Jason and thank you for contacting Infragistics. Please try the following as I was able to use this to acquire the row count in a loop that looks at each row's ChildBands row count.

    = SwfWindow("Form1").SwfTable("ultraGrid1").RowCount()

    Set grid = SwfWindow("Form1").SwfTable("ultraGrid1")
    For i=0 To d-1 Step 1

    childBandsCount = grid.GetNAProperty("Rows["+CSTR(i)+"].ChildBands.Count")
    MsgBox(childBandsCount)

     childRowsCount = grid.GetNAProperty("Rows["+CSTR(i)+"].ChildBands[0].Rows.Count")
                          MsgBox(childRowsCount)
     
    Next 

Children