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. General Programming
  3. Visual Basic
  4. Recalculating values in a datagrid with values fom textbox

Recalculating values in a datagrid with values fom textbox

Scheduled Pinned Locked Moved Visual Basic
databasehelpquestion
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.
  • B Offline
    B Offline
    BORN again
    wrote on last edited by
    #1

    Hello, I have a datagrid which is databound.Users enter the data into the webform which is saved into the database and this data is later retrieved and viewed in a Datagrid. As of now about 200 records have been created and they are all visible in the datagrid. The next step is that on the datagrid page, there is a textbox to enter monthly exchange rate on the top of the page i.e. outside the datagrid, users will enter a value in this textbox and based on that value 3 columns in the datagrid need to be recalculated. eg: enter EOMRate: ____________ (this is a textbox) | V This is the datagrid ____________________________________________________ regno buyamt sellamt bankname SpotRate Range ____________________________________________________ 1 20000 30000 DBAL 0.65 Within Range 2 3 -- -- 200 _________________________________________________________ Once the EOM rate is entered in the textbox then buyamt and sellamt will be recalculated in the datagrid for all 200 records. Is it possible to achieve this?Any help, guidelines? Thankyou very much for kindly sparing your time to read this post and help me solve it. Aartee. ...HE is watching Us All!

    P 1 Reply Last reply
    0
    • B BORN again

      Hello, I have a datagrid which is databound.Users enter the data into the webform which is saved into the database and this data is later retrieved and viewed in a Datagrid. As of now about 200 records have been created and they are all visible in the datagrid. The next step is that on the datagrid page, there is a textbox to enter monthly exchange rate on the top of the page i.e. outside the datagrid, users will enter a value in this textbox and based on that value 3 columns in the datagrid need to be recalculated. eg: enter EOMRate: ____________ (this is a textbox) | V This is the datagrid ____________________________________________________ regno buyamt sellamt bankname SpotRate Range ____________________________________________________ 1 20000 30000 DBAL 0.65 Within Range 2 3 -- -- 200 _________________________________________________________ Once the EOM rate is entered in the textbox then buyamt and sellamt will be recalculated in the datagrid for all 200 records. Is it possible to achieve this?Any help, guidelines? Thankyou very much for kindly sparing your time to read this post and help me solve it. Aartee. ...HE is watching Us All!

      P Offline
      P Offline
      prathiba_naresh
      wrote on last edited by
      #2

      I assume the datagrid is connected to a database. Once the Exchange rate is specified you can recalculate the the Buyamt ans sellamt and store in the database. Refreshing the Datagrid should pick up the latest values from the database. If its not directly connected to the database, taking into acct the volume of records i don't see any better solution than going in for a temp datatable to store these buyamt and sellamt and binding it to the datagrid.

      B 1 Reply Last reply
      0
      • P prathiba_naresh

        I assume the datagrid is connected to a database. Once the Exchange rate is specified you can recalculate the the Buyamt ans sellamt and store in the database. Refreshing the Datagrid should pick up the latest values from the database. If its not directly connected to the database, taking into acct the volume of records i don't see any better solution than going in for a temp datatable to store these buyamt and sellamt and binding it to the datagrid.

        B Offline
        B Offline
        BORN again
        wrote on last edited by
        #3

        Hi Pratibha, Thankyou for your Reply.Yes the datagrid is connected to the database. so as per your solution it also means I will need to introduce EOMRate as a new field in the datatable right? or maybe I don't need to and then I can calculate the buyamt and sellamt in the code behind the 'Calculate' button and call Refreshgrid() which will display the new values. So I do not really need to touch the datagrid(geeee that's great!) well, it does sound quite straightforward...I will go ahead with this solution and see how it works. Thanks a lot. Aartee. ...HE is watching Us All!

        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