我想添加gridview的第5列值,我该怎么做? [英] I want to add the 5th column values of my gridview how can i do that?

查看:78
本文介绍了我想添加gridview的第5列值,我该怎么做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加gridview的第5列值我该怎么办?



紧急

请帮帮我



提前感谢...

I want to add the 5th column values of my gridview how can i do that?

its urgent
please help me

thanks in advance...

推荐答案

例如第一行的第5列:



E.g. 5th column of first row:

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.


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;
                }
            }


这篇关于我想添加gridview的第5列值,我该怎么做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆