Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Forum
How can I add label to calculate from a gridview
July 24, 2012
I have a grid view with three columns
Weight | Completion | Score
2 | 0.50 | 1
5 | 0.50 | 2.5
4 | 0.50 | 2
The score column is a result of weight*completion which is working fine
Now, what I am asking is that i want to add labels outside the gridview to do some caculations, i don't want it to be included inside the gridview but separated.
and the labels to be like:
Label1 = (Total or sum) of weight column
Label2 = (Total or sum) of Score column
Label3 = (Label2 / Label1)*100
How can I perform such calculations for this?
I'm new at this and i am using c# .net web application
NOTICE: I don't have a behind code only aspx code page
Syed Shakeer Hussain
Posted Date: July 25, 2012 Points: 20
you can try this. but it needs DataSet.
DataSet ds=new DataSet();
DataTable table=new DataTable();
Label1.Text =Convert.ToString( table.Compute("Sum(Weight)", String.Empty));
To post reply
Related Questions Related Questions
calculate running total when entering quantity in gridview ..
pass label text from gridview to a query string
How to display Searched Records in Highlight way inside GRIDVIEW ?
how to display photo of members in gridview at run time?
how to validate the gridview
Checkbox inside Gridview in asp.net
Loading the GridView
Need to open popup window from the GridView
how its display the data gridview in vb.net?
How to place hyperlink in GridView
Latest Forum Questions From The Same Category
Slash(/) in Combobox
attaching the report in the web page
How do i get payment status in redirect page using bitpay?
Login with Facebook and Save details in database
Login with facebook account in my website
How to make a nested datalist control?
What class does Icon derive from?
What are the validation controls?
What''s the difference between an interface and abstract class?
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Quick Links For Forum Categories:
Hall of Fame
Terms of Service
Tell A Friend