惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
P
Proofpoint News Feed
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
F
Fortinet All Blogs
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
C
Check Point Blog
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
月光博客
月光博客
美团技术团队
D
Docker
博客园 - Franky
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

博客园 - angelfeather

json中获取key值 iOS开发常用代码块(2) 区别不同浏览器,CSS hack写法 [推荐]13款js编辑器大全 web标准 CSS Sprites 用户控件(.ascx)与网页间(.aspx)如何传值的几种方法 彩色验证码 一段常用的Page_Load事件 (如果有更好的希望大家留言) - angelfeather - 博客园 c#.net常用函数和方法集 ASP.NET中$#=的用法 - angelfeather - 博客园 利用MD5加密数据库中的密码 - angelfeather - 博客园 小记一篇~ - angelfeather - 博客园 推荐一个.net代码查看器Reflector 推荐一个学习asp.net的好地方 简单的ArrayList遍历 Microsoft .Net 框架 SDK 快速入门教程 asp.net简单的md5算法 遍历页面的所有button控件 GridView格式化导出Excel GridView导出Excel
GridView统计数据和修改Cell
angelfeather · 2008-06-18 · via 博客园 - angelfeather

    /// <summary>
    
/// 绑定数据
    
/// </summary>
    
/// <param name="sender"></param>
    
/// <param name="e"></param>

    protected void GridViewXinXiLan_RowDataBound(object sender, GridViewRowEventArgs e)
    
{

        
if (e.Row.RowType == DataControlRowType.DataRow)
        
{
            totalstock 
+= Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "生产量本年实际"));

        }

        
else if (e.Row.RowType == DataControlRowType.Footer)
        
{
            e.Row.Cells[
1].Text = "统计";
            e.Row.Cells[
1].HorizontalAlign = HorizontalAlign.Right;
            e.Row.Cells[
4].Text = totalstock.ToString();
            e.Row.Cells[
4].HorizontalAlign = HorizontalAlign.Right;

        }

        
    }


    
/// <summary>
    
/// 修改数据
    
/// </summary>
    
/// <param name="sender"></param>
    
/// <param name="e"></param>

    protected void ButtonLoad_Click(object sender, EventArgs e)
    
{
        
// 修改数据
        GridViewXinXiLan.Rows[5].Cells[4].Text = "test";
        GridViewXinXiLan.FooterRow.Cells[
4].Text = "统计测试";
    }