Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please help me

i am trying for

http://www.gregorylane.com/article.aspx?ID=1

but unable to get the out put

i.e please see the subtotal
every column has it's own total at bottom cell

same way i was trying

below link gives output

http://blog.codovations.com/2009_05_01_archive.html

but it's providing subtotal in merged way
Posted
Comments
Adam R Harris 5-Feb-13 21:48pm    
You need to give us more information on what exactly the problem is as well as post your code samples. Please use the Improve question button to update your question.
mani.kishore.asp.net 5-Feb-13 21:59pm    
i have 3 columns

names english marks maths marks

if both names are same like

a 20 marks 30 marks
a 15 marks 10 marks

i am trying for output to be like
35 marks 40 marks at bottom of their respective columns.

HI,

You can use like the following.

C#
decimal a=0, b=0, c=0;

for (int i = 0; i < (gridview1.Rows.Count); i++)
           {
               a = Convert.ToDecimal(gridview1.Rows[i].Cells["Column Index"].Text.ToString());
               c = c + a; //storing total qty into variable
}



Thanks
 
Share this answer
 
Comments
mani.kishore.asp.net 5-Feb-13 21:56pm    
how to display at bottom of the column..
[no name] 5-Feb-13 22:01pm    
You can do that in the footer section. Or you can have a simple div at the bottom of the grid and then assign the value of the result to the level placed in the div.
mani.kishore.asp.net 5-Feb-13 22:07pm    
my code has grouped the grid view, for each group total to be assigned.
i have 3 columns

names english marks maths marks

if both names are same like

a 20 marks 30 marks
a 15 marks 10 marks

i am trying for output to be like
35 marks 40 marks at bottom of their respective columns.

next for b marks
[no name] 5-Feb-13 22:15pm    
Instead of adding a duplicate row to the grid you can able to add the duplicate columns in the query for better result. This will also look good.
 
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