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. how to add a new row in a grid at runtime

how to add a new row in a grid at runtime

Scheduled Pinned Locked Moved ASP.NET
csswpfwcfhelptutorial
1 Posts 1 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.
  • J Offline
    J Offline
    jamesmani2k5
    wrote on last edited by
    #1

    using a grid i have created two rows by binding the hidden template field with a datasource in pageload event, Now i have to Add a new row in the grid using a button click....maitaining the values in the textbox in the grid entered by user.... ========================= <%# Eval("ROW") %> coding in page_load event is =================================== protected void Page_Load(object sender, EventArgs e) { Addrow(dgLocsch, 2); } private void Addrow(DataGrid dg, int NoOfRows) { DataTable dt = new DataTable(); dt.Columns.Add("ROW"); for (int i = 1; i <= NoOfRows; i++) { DataRow dr; dr = dt.NewRow(); dr["ROW"] = i.ToString(); dt.Rows.Add(dr); } dg.DataSource = dt; dg.DataBind(); } can any one help me......

    thank u

    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