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. GridView with Add New Row functionality

GridView with Add New Row functionality

Scheduled Pinned Locked Moved ASP.NET
help
4 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.
  • A Offline
    A Offline
    AS 13
    wrote on last edited by
    #1

    Hello Everybody, I have a Gridview in which I need a add new row functionality. My Gridview is generated dynamically I want the functionality like in the last column of the gridview there is a button/Image,when I click on it a new row should added to the gidview along with all the data in the row as the 1st row content. Name Year Address CheckBox Add Ashok 2008 CP + Rahul 2007 Delhi + Plz help me out

    A key to every Solution

    N 1 Reply Last reply
    0
    • A AS 13

      Hello Everybody, I have a Gridview in which I need a add new row functionality. My Gridview is generated dynamically I want the functionality like in the last column of the gridview there is a button/Image,when I click on it a new row should added to the gidview along with all the data in the row as the 1st row content. Name Year Address CheckBox Add Ashok 2008 CP + Rahul 2007 Delhi + Plz help me out

      A key to every Solution

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      AS@13 wrote:

      My Gridview is generated dynamically

      Is ASP.NET maintaining viewstate for this ? In which event are you creating this ?

      AS@13 wrote:

      t a new row should added to the gidview along with all the data in the row as the 1st row content.

      I presume you are binding GridView with a datatable. When new row is requested, add a new row to datatable and bind it to gridview.

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      A 1 Reply Last reply
      0
      • N N a v a n e e t h

        AS@13 wrote:

        My Gridview is generated dynamically

        Is ASP.NET maintaining viewstate for this ? In which event are you creating this ?

        AS@13 wrote:

        t a new row should added to the gidview along with all the data in the row as the 1st row content.

        I presume you are binding GridView with a datatable. When new row is requested, add a new row to datatable and bind it to gridview.

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        A Offline
        A Offline
        AS 13
        wrote on last edited by
        #3

        Thanks, But then there is a problem.. I have to save all the data input by the user in previous rows in somewhere and bind to the gidview again at the every click of the Add button as my DataTable is disposed when page is send to the browser. Plz tell me better idea or some modification in this.. Happy Coding.

        A key to every Solution

        N 1 Reply Last reply
        0
        • A AS 13

          Thanks, But then there is a problem.. I have to save all the data input by the user in previous rows in somewhere and bind to the gidview again at the every click of the Add button as my DataTable is disposed when page is send to the browser. Plz tell me better idea or some modification in this.. Happy Coding.

          A key to every Solution

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          You can keep your datatable in Session/ViewState. This allows you to persist it's data on post backs.

          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

          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