Click here to Skip to main content
15,894,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to add the 5th column values of my gridview how can i do that?

its urgent
please help me

thanks in advance...
Posted
Comments
vijay__p 6-May-13 7:13am    
BTW you have asked same question again. :)

E.g. 5th column of first row:

C#
if(Gridview.Rows[0].Cells[4].Text=="Seshu The Baadshah")
{
   Response.write("Its that simple.Try googling something.");
}


it depends on where you want to check for the same.
 
Share this answer
 
v2
C#
var total = 0;
            foreach (GridViewRow row in GridView1.Rows)
            {
                var numberText = row.Cells[5].Text;
                int number;
                if (int.TryParse(numberText, out number))
                {
                    total += number;
                }
            }
 
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