Forum Discussion

Anumakonda_mahe's avatar
Anumakonda_mahe
Frequent Contributor
13 years ago

How to Get Rowindex from WEB datagrid

Hi,



Pls. let me know how to get row index from Datagrid. In my application we have to search the record with user name and need to select Checkbox.

Application developed : VB . NET ()



I have to search the User ID and select Checkbox against the same. Pls. check the screen shot and pls. let me know the VB Script Code for the same.

2 Replies

  • Anumakonda_mahe's avatar
    Anumakonda_mahe
    Frequent Contributor
    Hi Tanya,



    i got it i have written below code



    Sub Clickrecord(Searchvalue)

     

    Dim RowInd

     

    RowInd  = NameMapping.Sys.iexplore.mainpage.formF1.table.cell.table.cell.frameAppbody.frameBodyframe.formF1.tableMaintable.cell.tableSubtable.cell.tableDatagrid1.Find( Array("innerText") , Array(Searchvalue), 1000, True).Parent.RowIndex

      NameMapping.Sys.iexplore.mainpage.formF1.table.cell.table.cell.frameAppbody.frameBodyframe.formF1.tableMaintable.cell.tableSubtable.cell.tableDatagrid1.cell(RowInd,6).Checkbox("AUSR").Click

     

    End Sub


  • Hi Anumakonda,


     


    What grid is used in your application (what is the value of the control's WndClass property)? First of all, check whether it's on the list of the supported controls by TestComplete. Otherwise, you need to use native methods and properties of the control to accomplish your task. For this, refer to the control's documentation.