How to extract a table cell's textbox data?
-
I want to traverse a 3 column table to get the 3rd column's textbox data. The first 2 cell's have text assigned to the cell (cell.text="xyz"). When I run this, column 2 cell's text is read with no problem: for(int i=1; i<=TasksTable.Rows.Count-1; i++) { string txtColumn2 = TasksTable.Rows[i].Cells[1].Text; } However I get error message when I try to use FindControl or do something like: for(int i=1; i<=TasksTable.Rows.Count-1; i++) { // Or like.. txtColumn3 = TasksTable.Rows[i].Cells[2].Text; TextBox txtColumn3 = (TextBox)TasksTable.Rows[i].Cells[2].FindControl ("Hours"); } Your syntax help would be appreciated. Thanks in advance if you don't hear from me, Jim.:confused:
-
I want to traverse a 3 column table to get the 3rd column's textbox data. The first 2 cell's have text assigned to the cell (cell.text="xyz"). When I run this, column 2 cell's text is read with no problem: for(int i=1; i<=TasksTable.Rows.Count-1; i++) { string txtColumn2 = TasksTable.Rows[i].Cells[1].Text; } However I get error message when I try to use FindControl or do something like: for(int i=1; i<=TasksTable.Rows.Count-1; i++) { // Or like.. txtColumn3 = TasksTable.Rows[i].Cells[2].Text; TextBox txtColumn3 = (TextBox)TasksTable.Rows[i].Cells[2].FindControl ("Hours"); } Your syntax help would be appreciated. Thanks in advance if you don't hear from me, Jim.:confused: