HI Guys,
When I add a textbox to my table cell then then add the table cell to the table row. Then I try access that control it always comes back null.
After the last line of code I break and try a quick watch.Code:newTextBox = new TextBox(); newTextBox.ID = "row_1Col_1"; newTextBox.Font.Size = FontUnit.Medium; newTextBox.Width = 70; newTextBox.Text = "Blah" acell.Controls.Add(newTextBox); arow.Cells.Add(acell);
acell.FindControl("row_1Col_1") which comes back null
I also try
arow.FindControl("row_1Col_1") which also comes back null.
before this code I do a quick watch on arow.controls.count which comes back as 0, then after the code I do the same thing and it comes back as 1. So I know it's getting added, but can't seem to get back to the textbox value.
is there a way to list all the controls or something? Because I think it changes the name or something.
I know this code is in C#, but it's the same idea in VB. IF I'm wrong please redirect the post to the right thread thanks.


Reply With Quote

