C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

asp.net with C#


Posted Date: 21 Nov 2008      Posted By: prisilla      Member Level: Bronze     Points: 1   Responses: 2



am using asp.net with c# and sql server 2000.am having problem in datagrid.
am having textbox inside edititemtemplate.i want to calculate 4 textbox values and automatically result should be in another textbox.

** if i entered values in textbox inside edititemtemplate that time i want to fire this calculation.datagrid not gridview






Responses

Author: Williams    21 Nov 2008Member Level: GoldRating: Revenue Score: 0     Points: 0

hi, try using the onblur event of the textbox and start calculating the sum of the values in the textboxes and assign it to the final textbox.Everything should be done on client side using javascript.
onblur event of textbox is client side event.

The javascript function would be like

function CalculateSum()
{
var txt1 = document.getElementById('TextBox1').value
var txt2 = document.getElementById('TextBox2').value
var txt3 = document.getElementById('TextBox3').value
var txt4 = document.getElementById('TextBox4').value
document.getElementById('TextBox5').value = txt1 + txt2 + txt3+ txt4
}

try calling the above function on the onblur event of the final text box when u want to calcualte the actual sum .



Author: Jaydeep Patil    21 Nov 2008Member Level: BronzeRating: 2 out of 52 out of 5     Points: 1

fire this calculation.datagrid in textbox_leave event


Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : uploading of images using file upload control
Previous : Change the data type in back end using programatically
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use