Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Add new cell in htmltable control

Add new cell in htmltable control

Scheduled Pinned Locked Moved ASP.NET
helpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mohammed Elkholy
    wrote on last edited by
    #1

    i have a web page that displays data from dataset in HtmlTable i add linkbutton in specific cell i want whaen i click this linkbutton add new table cell in the specific cell i hope my question clear thanks for help

    MD_NADA

    B T 2 Replies Last reply
    0
    • M Mohammed Elkholy

      i have a web page that displays data from dataset in HtmlTable i add linkbutton in specific cell i want whaen i click this linkbutton add new table cell in the specific cell i hope my question clear thanks for help

      MD_NADA

      B Offline
      B Offline
      badgrs
      wrote on last edited by
      #2

      You want to add a new cell within the one containing the link button? A nested cell? HTML tables don't work like that....

      1 Reply Last reply
      0
      • M Mohammed Elkholy

        i have a web page that displays data from dataset in HtmlTable i add linkbutton in specific cell i want whaen i click this linkbutton add new table cell in the specific cell i hope my question clear thanks for help

        MD_NADA

        T Offline
        T Offline
        tarasp
        wrote on last edited by
        #3

        If you create the table like this:

        <asp:Table ID="MyTable" runat="server"></asp:Table>

        then you can add rows and/or cells like this:

        TableRow tr = new TableRow();
        TableCell td = new TableCell();

        tr.Controls.Add(td);
        MyTable.Controls.Add(tr);

        Tara

        M 1 Reply Last reply
        0
        • T tarasp

          If you create the table like this:

          <asp:Table ID="MyTable" runat="server"></asp:Table>

          then you can add rows and/or cells like this:

          TableRow tr = new TableRow();
          TableCell td = new TableCell();

          tr.Controls.Add(td);
          MyTable.Controls.Add(tr);

          Tara

          M Offline
          M Offline
          Mohammed Elkholy
          wrote on last edited by
          #4

          this is right thank you but if i did this code the row will be the last row i want to add the new row after the current row if i am clicking in rowindex 2 the new row will be rowindex 3 thanks

          MD_NADA

          B 1 Reply Last reply
          0
          • M Mohammed Elkholy

            this is right thank you but if i did this code the row will be the last row i want to add the new row after the current row if i am clicking in rowindex 2 the new row will be rowindex 3 thanks

            MD_NADA

            B Offline
            B Offline
            badgrs
            wrote on last edited by
            #5

            Use Table.Rows.AddAt(index, row)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups