protected void gvInfos_RowDataBound(object sender, GridViewRowEventArgs e)
{
int sumdays = 0;
if (e.Row.RowType == DataControlRowType.DataRow)
{
//sumdays = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "WDays"));
//sumdays = int.Parse(DataBinder.Eval(e.Row.DataItem, "WDays").ToString());
sumdays = int.Parse(e.Row.Cells[2].Text);
}
else if (e.Row.RowType == DataControlRowType.Footer) //页脚
{
e.Row.Cells[0].Visible = false;
e.Row.Cells[1].Text = "合计:";
e.Row.Cells[1].ColumnSpan = 2;
e.Row.Cells[1].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[2].Text = sumdays.ToString();
}
}
解决方案 »
- 关于 magicajax
- as3.0读取xml,xml加载完成时,根据xml属性值添加影片剪辑,在网页中不起作用,直接打开swf可以正常显示
- DataList中加<img runat="server" /> 运行出错
- Page.LoadTemplate 和 Page.LoadControl 到底有啥区别,分别用在什么场合比较合适?
- gridview中嵌套gridview(二者是主从关系)??急~~~~~~
- 如何在web页面中画点??请高手指教
- 用了孟先生导出到excel的方法后发现一个问题,就是没有把我的css格式也一并导出,导致excel格式还是原始格式,怎么处理啊?
- 高分求解如何得到toolbar里的dorpdownlist里的值
- 有 哈尔滨 搞asp.net的吗?留下QQ,,,,,
- 如何在asp.net中动态添加单选框
- 求正则处理一下字符串
- HttpWebRequest+WebProxy+内网,请教任何代理IP为何都报403错误?
if (e.Row.RowType == DataControlRowType.DataRow)
{
//sumdays = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "WDays"));
//sumdays = int.Parse(DataBinder.Eval(e.Row.DataItem, "WDays").ToString());
sumdays = int.Parse(e.Row.Cells[2].Text);
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
//sumdays = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "WDays"));
//sumdays = int.Parse(DataBinder.Eval(e.Row.DataItem, "WDays").ToString());
sumdays = int.Parse(e.Row.Cells[2].Text);
}
if (e.Row.RowType == DataControlRowType.Footer) //页脚
{
e.Row.Cells[0].Visible = false;
e.Row.Cells[1].Text = "合计:";
e.Row.Cells[1].ColumnSpan = 2;
e.Row.Cells[1].HorizontalAlign = HorizontalAlign.Right;
e.Row.Cells[2].Text = sumdays.ToString();
}
http://www.cnblogs.com/insus/articles/1433589.html