getting properties of controls inside a table control

Hi,

I h ave a Table control "tbl" in which I am adding other controls such as textboxes and labels dynamically. 

I am trying to access the propertiesof the controls, such as label1.text and textbox1.text , that I dynamically created and added into the table control. 

The tbl has two columns, in the first column it has labels and textboxes in the second one 

Is there anyway I can access the properties of all the controls that I added in different columns and rows of table control by looping through the table. 


Something like, 

string temp; 
for(int i-0;i<=(number of rows in the tbl);i++) 

for(j=0;j<=2;j++) 

temp+=tbl.rows[i].Controls[i].ID ; 




Answer this question

getting properties of controls inside a table control

  • Dirk Rombauts

    you do this via reflection, you can even run methods via reflection.

    take a look at this project.

    http://www.planet-source-code.com/vb/scripts/ShowCode.asp txtCodeId=1335&lngWId=10

    for your answer

  • getting properties of controls inside a table control