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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. datatable to gridview

datatable to gridview

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.
  • S Offline
    S Offline
    sangramkp
    wrote on last edited by
    #1

    Hi, I have 3 columns in a gridview statrtAmount, endAmount, account and a btnColumn which is of type link(remove) and I have two text boxes on a page txtStartAmount and txtEndAmount, on a button click i want to add a row to the gridview with the values of the textBoxes and the StartAmount column being 1+ the latest EndAmount. On clicking the remove link in the row it will delete the clicked row and the subsequent rows start amount will be 1+ EndAmount of the previous row then the row deleted. i am a little confused please help..... Account will be just input withiout calculations and the first value of the StartAmount will be 1 on page load Help.... :rose:

    Sangram (A battle with self) Life is simple, we are the ones makes the living difficult

    I 1 Reply Last reply
    0
    • S sangramkp

      Hi, I have 3 columns in a gridview statrtAmount, endAmount, account and a btnColumn which is of type link(remove) and I have two text boxes on a page txtStartAmount and txtEndAmount, on a button click i want to add a row to the gridview with the values of the textBoxes and the StartAmount column being 1+ the latest EndAmount. On clicking the remove link in the row it will delete the clicked row and the subsequent rows start amount will be 1+ EndAmount of the previous row then the row deleted. i am a little confused please help..... Account will be just input withiout calculations and the first value of the StartAmount will be 1 on page load Help.... :rose:

      Sangram (A battle with self) Life is simple, we are the ones makes the living difficult

      I Offline
      I Offline
      Imran Khan Pathan
      wrote on last edited by
      #2

      create one datatable dynamically,add four columns startAmount,endamount,account and one column for ID(autoincreament) Add rows in the datatable when u click to add values. bind gridview with this datatable. Now when u click on remove button then u can get clicked rows ID and U can delete rows using this ID from datatable. Best Regard Pathan

      ---------------------------------------------------

      S 1 Reply Last reply
      0
      • I Imran Khan Pathan

        create one datatable dynamically,add four columns startAmount,endamount,account and one column for ID(autoincreament) Add rows in the datatable when u click to add values. bind gridview with this datatable. Now when u click on remove button then u can get clicked rows ID and U can delete rows using this ID from datatable. Best Regard Pathan

        ---------------------------------------------------

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

        Thanks Pathan.... Now I want to store the values of the gridview to store in a database table....

        Sangram (A battle with self) Life is simple, we are the ones makes the living difficult

        I 1 Reply Last reply
        0
        • S sangramkp

          Thanks Pathan.... Now I want to store the values of the gridview to store in a database table....

          Sangram (A battle with self) Life is simple, we are the ones makes the living difficult

          I Offline
          I Offline
          Imran Khan Pathan
          wrote on last edited by
          #4

          looping through GridView.Rows.Count , find controls , get values and store in dataBase Best Regard Pathan

          ---------------------------------------------------

          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