Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi. I have an ASP.Net GridView which contains textboxes. I am going to add footer where it contains the sum of the same column and at the end of each row also a sum field is there. The number of rows may be vary in different report, but the columns are fixed.
Here is the jsFiddle http://jsfiddle.net/dUa85/21/[^] where it contains the html output. I was able to get near to what i expected, but the keystrokes are also getting counted. Please try to add values under Jan textboxes to get the problem duplicated.

Any solution? If more details are needed, please let me know.

Thank you for your time.
Posted
Updated 29-Aug-12 3:19am
v2

1 solution

The issue here is the id's of your month totals also have the same prefix of txtJan just like your items. There are multiple ways to fix this. Simplest is to change the prefix of the total field to something else - in this case I just changed it to txtItemJanTotal. I have forked your fiddle and fixed the issue there. Check it out!

http://jsfiddle.net/nXT7k/[^]

Another way is, during your $.each looping, check if the id is of the format txtJan[0-9] using Regex.

Hope this helps!
 
Share this answer
 
v2
Comments
Ravimallya 30-Aug-12 9:54am    
Hi Karthik.

Thank you for your solution. Yes, the issue fixed while I implementing it in the Gridview also.

Thanks again for your valuable time to check the problem.
Karthik. A 31-Aug-12 11:31am    
You are welcome Ravi !

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