I'm somewhat new to asp.net development, and so please excuse my ignorance.
I am trying to play around with building a timesheet and expense app, and i am stuck on trying to update a second field in the gridview by entering a value into a first field whilst remaining in the EditItem mode.
Basically, when entering expense items, I would like the user to be able to either enter a Net amount and have the VAT and Gross values calculated, or enter a gross amount and have the Net and VAT calculated. However, after entering a value, I want the gridview to remain in Edit mode, as the VAT might need to be keyed if there is a rounding difference causing it to be a penny out.
I have set the Net, VAT, and Gross fields to be Template fields, and have set the following properties of the Net asp:TextBox:
OnTextChanged="DoNetVATGrossUpdate" AutoPostBack="true"
The code is called okay. However, I haven't got a clue what code to put in there to change the VAT and Gross fields. I did manage to update the field, but this was by finding the parent of the sender (the gridview), finding the row index of the cell being modified, and then setting the GridView.Cells(row index number).Text = VATAmount. However, this made the cell show a value, but removed the data binding.
Is it possible to do what I want to do in the GridView, and if so, how?
Thanks in advance for any advice.