protected void DataGrid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
int gzcs=0;
if (e.Item.ItemIndex >= 0)
dbArg += int.Parse(e.Item.Cells[3].Text);
else if (e.Item.ItemType == ListItemType.Footer)
{
e.Item.Cells[0].Text = "汇 总";
e.Item.Cells[3].Text = gzcs.ToString();
}
}
{
int gzcs=0;
if (e.Item.ItemIndex >= 0)
dbArg += int.Parse(e.Item.Cells[3].Text);
else if (e.Item.ItemType == ListItemType.Footer)
{
e.Item.Cells[0].Text = "汇 总";
e.Item.Cells[3].Text = gzcs.ToString();
}
}
解决方案 »
- IIS发布网站问题
- 自动刷新页面部分内容...Ajax 吗 ?
- 请教vb.net中class内定义的const类型成员变量和shared类型成员变量的区别
- 出现找不到文件或程序集名称“Microsoft.Web.UI.WebControls”,或找不到它的一个依赖项的错误提示。急啊
- 分页出错的问题,怪事!
- 如何遍历一网站目录下的所有文件??
- ■datagird 显示宽度问题■
- 怎么在一个空报表中动态加入要显示的字段和数据?登陆代码请进
- <%# Container.DataItem("我的数据") %>在<% %>中如何使用这个"我的数据"字段?
- NET技术思考,文章很长,没有闲心别看了
- DataGrid分页中删除行的问题
- 我装的xp+sp2 运行asp.net 装sql 2000的什么版好啊?在线等,急!!!
int gzcs=0;
if (e.Item.ItemIndex >= 0)
gzcs += int.Parse(e.Item.Cells[3].Text);
else if (e.Item.ItemType == ListItemType.Footer)
{
e.Item.Cells[0].Text = "汇 总";
e.Item.Cells[3].Text = gzcs.ToString();
}
你可以把gzcs定义为全局变量,放到的_ItemDataBound定义外面
e.Item.Cells[3].Text = dbArg.ToString();