adding a control to a cell in table

Discussion in 'ASP .Net' started by nemesis.saurabh, May 24, 2006.

  1. hi,
    i am adding a user control to a table of size 3x3 on runtime.

    tabSec.Rows[0].Cells[1].Controls.Add(HtmlPlaceholderControl3);

    but it is throwing an exception : property index out of range
    regards,
    saurabh
     
    nemesis.saurabh, May 24, 2006
    #1
    1. Advertisements

  2. what's tabSec?

    gridview? datagrid?
     
    Bruno Alexandre, May 24, 2006
    #2
    1. Advertisements

  3. tabSec is a normal table....
    can say...

    table.Rows[0].Cells[1].Controls.Add(controlname);
     
    nemesis.saurabh, May 25, 2006
    #3
  4. I did never work with that...

    as a lot of peoples used to say: "There is a lot ways to kill a fly"

    use Panels instead, and on runtime show/hide the panel you want, and you can
    put as many controls you like on one panel... for your example, build 2
    panels, one with the table without the control, and other with it...
     
    Bruno Alexandre, May 25, 2006
    #4
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.