Hi Team,
There is a multi-band grid , now i want to get the text of 'Test4' using 'GetCellData' like this
<==
strData = SwfWindow("Application 8.0.0").SwfWindow("Review Recon").SwfTable("grdRecords").GetCellData ("2;0","Investment")
Print strData
==>
but the value always display as 'Test2', so could you please show me an example how to get the value 'Test4' or any comments about using the GetCellData with multi-band grid, many thanks !
I am using this and this works
Sub GetCellData_Example1() 'The following example uses the GetCellData method with Infragistics UltraWinGrid control to return the data 'contained in the second row of the "Description" column within the second band level.
MyData =SwfWindow("EMT").SwfWindow("EMTReinsurance").SwfTable("ugAviLayers").GetCellData("0;0","PolicyRef") MsgBox MyData End Sub Call GetCellData_Example1()
But i want to get the cell data at run time by using getrow count and column count but i have two bands.
how can i make that work ????
Hi dwei,
Unfortunately just looking at the picture I cannot tell you what the cell reference would be. This is because filtering, which you have enabled, and whose effects may not always be viewable because the column filtered could be hidden, and that filtering could be hiding hundreds of rows between the two rows on either or both band shown in your picture.
The reason why we have to take into account hidden rows, is because not all filtering hides rows, it is possible to have their appearance altered instead of removed. That all beings said, the easiest way to find the correct cell reference is to record an action on it, such as ActivateCell or SetCellData.
Dennis, thank your reply. As your said we did a lot of testing using dfferent index number , but no acturally value return. And in QTP help file for SwfTable -> GetCell Data only one example like this
< == Get Data from a Specified Cell in an 'Infragistics UltraWinGrid' Control
Sub GetCellData_Example1()'The following example uses the GetCellData method with Infragistics UltraWinGrid control to return the data'contained in the second row of the "Description" column within the second band level.MyData = SwfWindow("Layouts").SwfTable("gridOne").GetCellData("0;1", "Description")MsgBox MyDataEnd Sub
Seems for multi-band grid no API provide by the Infragistics TestAdvantage,do your have any other information or comment on that?
Thanks.
It looks like one of the numeric arguments for GetCellData is not correct. If "2;0" is returning "Test2", then try changing either the "2" to "3" and/or the "0" to "1" and see if that returns the expected value (see the QTP Help file for an example).