I’m not familiar with an HTML grid, are you using a Gridview? If so, you can loop through them as dynamic columns but this can cause problems in the future, I find it much better to convert them to Template Columns. Then assign a unique id to each of the controls. Once this is done you can use code like this to loop through and gather data:
Dim myRow as GridViewRow
For each rmyRw in Gridview1.Rows
dim myLabel as new Label
myLabel = myRow.Cells(3).FindControl(“Label3″)
response.write myLabel.Text
Next
In this example I have a Label in Column 3 with an ID of Label3. It loops through the gridview and writes the value of that label. This can be used for Text Boxes, Radio Buttons, Check Boxes, Drop Down Lists, etc… I use it all the time, it works great for me.
Comments
Leave a comment Trackback