You can't do like this as there are
TextBoxes
for each
Row
.
For instance
txtWithdrawalAmount
will be present in all rows of the
GridView
.
So, if you access like below...
int WithdrawalAmount = Convert.ToInt16(txtWithdrawalAmount.Text.Trim());
It will not work.
Rather you should run a Loop
foreach
Row
of
GridView
and inside the Loop get the
TextBox
values.