如何把DataGrid中某一列的统计值显示在页脚中 如題 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 int count=0;foreach(DataGridItem item in dgResult.Items){ if(item.ItemType == ListItemType.Footer) { item.Cells[0].Text=count.ToString(); } else { count+=Convert.ToInt32( item.Cells[0].Text ); }} 很奇怪,沒有遍歷到頁腳,item.ItemType == ListItemType.Footer 有問題 private void Datagrid2_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { //项绑定完成。这里完成统计++ } } 很奇怪,沒有遍歷到頁腳,item.ItemType == ListItemType.Footer 有問題-----------------你的datagrid有页脚吗? 前台循环输出(请问要怎样输出?) 弹出小窗口选择用户,然后传回主页面 sqlS数据库插入操作! 请教如何让ASP.Net日历只显示当月的日期。其它月份的日期不要显示? 求一条日期正则?规定输入:2005-1-1或2005-10-1.不能出现2005-01-01之类 网页中用了框架 在asp.net中怎样把数据从框架中的一个页面传递到另一个页面。 请问,怎么判定选中的按钮? 2003下iis调用ISAPI的问题? 关于文件下载问题,郁闷很久了 。。。 请帮我看看怎么了,谢谢! 菜鸟问一极弱智问题,忘高手不吝赐教!! 发一个html编辑器控件,带源码
foreach(DataGridItem item in dgResult.Items)
{
if(item.ItemType == ListItemType.Footer)
{
item.Cells[0].Text=count.ToString();
}
else
{
count+=Convert.ToInt32( item.Cells[0].Text );
}
}
{
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
//项绑定完成。这里完成统计++
}
}
-----------------
你的datagrid有页脚吗?