How to access value of cell in the IHTMLTableRow? RRS feed

  • Question


    Using legacy adaptor for web application.

    On downcomplete event i have to get value from the table .

    I wrote following code for it , but cannt figureout how to access particular cell value.?

    Row shows length as number of columns.


    //Get html document

    IHTMLDocument2 htmlDocument = (IHTMLDocument2)this.webBrowser.Document.DomDocument;


    //Retrieve table by tableID

    IHTMLTable table= (IHTMLTable) htmlDocument.all.item("tableID", null);


    object obj1=0;

    object objcol1 = 0;

    //Get row & column cell

    IHTMLTableRow tblRow = (IHTMLTableRow)table.rows.item(obj1, 0);

    IHTMLTableCell tblcol = (IHTMLTableCell)tblRow.cells.tags("ColName);


    Any help appreciated

    Tuesday, February 5, 2008 3:18 PM

All replies

  • You can get the cell using the same way you got the row. Have you tried that?
    You can also get the inner text of TR and look for the tablecell you need.
    You can use getElementById() if you have an id for the table, same with name.

    Let me know if you need further assistance.
    Sunday, February 24, 2008 4:41 PM