Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,

I have a gridview with 4 textbox columns.while entering the value, need to make calculation and set value to an another textbox template field in that gridview.

I need

1. to calculate NetAmount = (Rate * Qty)-Tax%-Disc%
2. Sum of net amount must be show in footer template field.
3.I have to make these calculation on key press event of textbox using javascript..




Please help me...

Thanks in advance..

Vineetha
Posted

1 solution

//Add this Code on the Page Load
txtboxFirstName.Attributes.Add ("onKeyPress", "javascript:onCC_Changed();")


//Then IT Calls the function Name onCC_Changed() on the javascript here u can Add ur Code for GridView Calculation.



var GridView = document.getElementById(gridid);
var inputList = GridView.getElementsByTagName("input");
for (var i = 0; i < inputList.length; i++) {

//GridView.rows[i].cells[1].innerHTML

if (inputList[i].type == "checkbox") {
if (inputList[i].checked) {

//here u can Add ur changes


}
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900