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
245
How to using GetCellData get the value with Infragistics UltraWinGrid .
posted

Hi team,

I want to get a cell data using the script like below.

<==

CountColumn = SwfWindow("Geneva Desktop 8.0.0").SwfWindow("Review Recon").SwfTable("grdRecords").ColumnCount()

Print CountColumn

 For i = 1 TO CountColumn -1

     i = Cstr(i)
   
    strData  = SwfWindow("Application 8.0.0").SwfWindow("Review Recon").SwfTable("grdRecords").GetCellData(3,i)

    Print  strData

Next     ==>

And we got an exception in below , but the CountColumn return > 100.

Question 1: In grid UI only 24  columns is Visible, So i guess the number has contain some hidden columns. Does that means the TestAdvantage can't access the grid value like this ?

Question 2: Is there any methods in TestAdvantage to get the cell value according to the column name ?

expect any reply , many thanks,

 <==

IG : The following key was not found [1]

Line (40): "strData  = SwfWindow("Application 8.0.0").SwfWindow("Review Recon").SwfTable("grdRecords").GetCellData(3,i)".

==>

 

 

Thanks,

David

Parents
No Data
Reply
  • 1040
    Verified Answer
    posted

    Try converting "i" to an integer (CInt), instead of a string (CStr). Here is an example of how I applied your code to one of our grids that has only six columns (all six are visible):

    Dim countColumn, iItem, strData
    countColumn = SwfWindow("CORT to ADP").SwfTable("payPeriodsGrid").ColumnCount
    'MsgBox countColumn
    For iItem = 0 TO countColumn - 1
         iItem = CInt(iItem)
         'MsgBox iItem
         strData = SwfWindow("CORT to ADP").SwfTable("payPeriodsGrid").GetCellData (3, iItem) 'row, column index
         MsgBox strData
    Next    

    I'm guessing that your code will return the cell data for all of the columns, not just the visible ones, so you might have to include an If statement to determine if the column is Hidden or not. You can use GetNAProperty to determine the Hidden status: object.GetNAProperty("DisplayLayout.Bands[x].Columns[y].Hidden"), where x = the Band Index and y = the Column Index. I'm pretty sure there are some other posts in this forum that explain how this can be done.

Children
No Data