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. Adding textbox to gridview at runtime

Adding textbox to gridview at runtime

Scheduled Pinned Locked Moved ASP.NET
helpquestion
2 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.
  • I Offline
    I Offline
    IamAmit
    wrote on last edited by
    #1

    Hello friends, I am using gridview and want to add textbox at runtime. The no of textboxes to add depends upon certain value. Is is possible? How? pls help me...thnx in advance..!

    K 1 Reply Last reply
    0
    • I IamAmit

      Hello friends, I am using gridview and want to add textbox at runtime. The no of textboxes to add depends upon certain value. Is is possible? How? pls help me...thnx in advance..!

      K Offline
      K Offline
      kontax
      wrote on last edited by
      #2

      To add a textbox runtime just try protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["txt"] = 0; } } public void name(object sender, EventArgs e) {int txt = (int)ViewState["txt"]; TextBox txt1 = new TextBox(); txt1.ID = "txt" + (++txt).ToString(); Panel1.Controls.Add(txt1); txt1.Text = ; ViewState["txt"] = txt; } After creating a Panel in the .aspx page. Can't understand why u need gridview. Hope it helps BYE

      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