Recalculating values in a datagrid with values fom textbox
-
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!
-
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!
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.
-
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.
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!