Groups | Blog | Home
all groups > asp.net webcontrols > february 2005 >

asp.net webcontrols : Adding controls to table


Tony
2/14/2005 12:01:59 PM
Win XP - VS 2002 - VB



I created a web forms table with 2 rows 2 cells each row.

I've created controls on design page 2 labels and 2 text boxes.

When adding the control to the table,

I used,

tblVendorDispute.Rows(0).Cells(0).Controls.Add(Label1)

tblVendorDispute.Rows(0).Cells(1).Controls.Add(textbox1)

They (controls) move their position but not inside the table, It almost
seems as if it has something to do with their original position on the
design page as to where they move.



Anything I'm doing wrong?



Thanks











Sean McKaharay
2/14/2005 2:20:41 PM
First you should probably add the controls dynamicly. If you didn't want to
you should look at the html written to the page. You have properties that
have the location of the control. When you drop the control on the page it
puts location tags on it. go to the html code on the page delete the
position stuff and it should work.


[quoted text, click to view]

AddThis Social Bookmark Button