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. Problem in Dynamically Created Table row [modified]

Problem in Dynamically Created Table row [modified]

Scheduled Pinned Locked Moved ASP.NET
designhelp
3 Posts 2 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.
  • S Offline
    S Offline
    suzzain
    wrote on last edited by
    #1

    Hi, I have a asp:table on aspx Page. Im adding dynamic rows to the table. The rows added dynamically are visible on the UI bt im unable to find those dynamically created rows in viewsource of the page. i.e they are not being rendered. I want to access controls value inside the table cell. i have added textbox control in the table cell whose value i want to calculate. How i can do that. Thank you all for your replies.

    modified on Monday, April 13, 2009 4:51 AM

    P 1 Reply Last reply
    0
    • S suzzain

      Hi, I have a asp:table on aspx Page. Im adding dynamic rows to the table. The rows added dynamically are visible on the UI bt im unable to find those dynamically created rows in viewsource of the page. i.e they are not being rendered. I want to access controls value inside the table cell. i have added textbox control in the table cell whose value i want to calculate. How i can do that. Thank you all for your replies.

      modified on Monday, April 13, 2009 4:51 AM

      P Offline
      P Offline
      Parwej Ahamad
      wrote on last edited by
      #2

      Could you post here your line code way of inding the controls ?

      Parwej Ahamad

      S 1 Reply Last reply
      0
      • P Parwej Ahamad

        Could you post here your line code way of inding the controls ?

        Parwej Ahamad

        S Offline
        S Offline
        suzzain
        wrote on last edited by
        #3

        In the .cs page the rows are added as: TableRow tr = new TableRow(); TableCell tcPlace = new TableCell(); Label lblPlaces = new Label(); lblPlaces.Attributes.Add("runat", "server"); lblPlaces.ID = "lblPlaces" + i; lblPlaces.Text = arrstrPlaces[i]; tcPlace.Controls.Add(lblPlaces); tr.Cells.Add(tcPlace); TableCell tcRate = new TableCell(); TextBox txtRates = new TextBox(); txtRates.Attributes.Add("runat","server"); txtRates.ID = "txtRates" + i; txtRates.Width = 50; txtRates.Attributes.Add("onkeypress", "fnAccpNumDecimal(event)"); tcRate.Controls.Add(txtRates); tr.Cells.Add(tcRate); TableCell tcrfv_FD = new TableCell(); RequiredFieldValidator rfv_FD = new RequiredFieldValidator(); rfv_FD.Attributes.Add("runat", "server"); rfv_FD.ID = "rfv_FD" + i.ToString(); rfv_FD.ControlToValidate = txtRates.ID; rfv_FD.ErrorMessage = "Insert Rates"; rfv_FD.Display = ValidatorDisplay.Dynamic; rfv_FD.SetFocusOnError = true; rfv_FD.Text = "*"; rfv_FD.EnableClientScript = true; rfv_FD.ValidationGroup = "check"; rfv_FD.Visible = true; rfv_FD.Enabled = true; rfv_FD.EnableViewState = true; tcrfv_FD.Controls.Add(rfv_FD); tr.Cells.Add(tcrfv_FD); tblRateDetails.Rows.Add(tr);

        modified on Monday, April 13, 2009 5:40 AM

        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