Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Gridview- Client Side Calculation using javascript
Rajkumar R
Aug 23 2017 8:27 AM
164
Reply
Hi,
I have a gridview with ITEM TEMPLATES for 12 fields, for each collumn set of calculations are there based on rows. Can you please provide me the sample code in JAVASCRIPT
LOOP THROUGH THE GRIDVIEW TEXTBOXES AND GET THE VALUE AND DO THE CALCULATION AND SHOW THE RESULT IN ONE OF THE ROWS.
Example :
If am in Cell 7, will take the value of Row1 + Row 2 - Row 7 - Row 9 and the total should be shown in Tow 12 of Cell 7
<asp:GridView ID="grdCIP" runat="server" GridLines="both"
AutoGenerateColumns="False"
forecolor="Black"
onrowdatabound="grdCIP_RowDataBound" DataKeyNames="CIP_CategoryId"
onrowcreated="grdCIP_RowCreated">
<asp:TemplateField HeaderText="Jan">
<ItemTemplate>
<asp:TextBox ID="txtJan" runat="server" Width="50px" Text='<%# Eval("Jan") %>' > </asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Combining multiple website in single portal
hyperLinkField value to pass to textbox on different page