Can't Find Controls in GridView on Dynamic Controls
问题 I have a gridview where I add textboxes to everycell on runtime. However, I can't seem to access those controls using findcontrol Here is how I add the textboxes to the gridview: If e.Row.RowType = DataControlRowType.DataRow Then For i = 1 To e.Row.Cells.Count - 1 Dim txtSchedule As New TextBox() txtSchedule.ID = "txtSchedule" & i.ToString e.Row.Cells(i).Controls.Add(txtSchedule) Next End If When I go to find the controls it says they are Nothing : GridView1.Rows(0).Cells(cellindex)