Hi
I have a datagrid/table where for each row (except the header) there are some hidden values, some showng info and a button.
What I'm wanting to do is loop through the rows and find in the first column the values in 2 hidden fields. If hidden1 and hidden2 match datavalue1 and datavalue2 then I can find the correct rowindex and therefore find the correct button to click.
I can successfully loop through the rows of the table, but i'm not sure how to find the value of the hidden fields for EACH row as I loop through.
I can find it on the page using
but not for each cell as I'm unsure how to refer to a partial ID for a hidden field.
This is what I have so far, the htmlinputhidden is incorrect:
I have a datagrid/table where for each row (except the header) there are some hidden values, some showng info and a button.
What I'm wanting to do is loop through the rows and find in the first column the values in 2 hidden fields. If hidden1 and hidden2 match datavalue1 and datavalue2 then I can find the correct rowindex and therefore find the correct button to click.
I can successfully loop through the rows of the table, but i'm not sure how to find the value of the hidden fields for EACH row as I loop through.
I can find it on the page using
Dim cpolicy As HtmlInputHidden = Pages.TravelInsuranceSalesSystem1.Get(Of HtmlInputHidden)("id=ctl00_ContentPlaceHolder1_TestGrid_ctl02_cpolicy")
but not for each cell as I'm unsure how to refer to a partial ID for a hidden field.
This is what I have so far, the htmlinputhidden is incorrect:
For Each r As HtmlTableRow In Pages.TravelInsuranceSalesSystem1.ContentPlaceHolder1TestGridTable.AllRows
if r.RowIndex <> 0 then
'ignore the header row
For Each c As HtmlTableCell In r.Cells
if c.CellIndex = 0 then
'column 1 only
Dim cpolicy As HtmlInputHidden = c.Get(Of HtmlInputHidden)("id=~cpolicy")
if cpolicy.Equals("TI") then
Log.WriteLine("cpolicy:" & cpolicy.Value )
end if
end if
Next
end if
Next