Adding controls to table

Discussion in 'ASP .Net Web Controls' started by Tony, Feb 14, 2005.

  1. Tony

    Tony Guest

    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
     
    Tony, Feb 14, 2005
    #1
    1. Advertising

  2. 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.


    "Tony" <> wrote in message
    news:%...
    > 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, Feb 14, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Williams
    Replies:
    2
    Views:
    1,176
    Jacob Yang [MSFT]
    Aug 12, 2003
  2. Richard Wilson
    Replies:
    0
    Views:
    6,292
    Richard Wilson
    Feb 26, 2004
  3. Jeremy Ames

    Adding controls to Page.Controls collection

    Jeremy Ames, Mar 4, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    1,461
    Peter Blum
    Mar 5, 2004
  4. Carl Gilbert
    Replies:
    0
    Views:
    941
    Carl Gilbert
    Jul 20, 2005
  5. Replies:
    1
    Views:
    419
Loading...

Share This Page