摘要: 自动求和代码如下:protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex >= 0) { sum += Convert.ToInt32(e.Row.Cells[4].Text); } else if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[1].Text = "总分为:"; e.Row.Cells[2].Text = sum.ToString(); e. 阅读全文
posted @ 2011-12-30 11:04 kuangkro 阅读(2129) 评论(0) 推荐(0)
摘要: 显示效果如图:后台代码如下:private void getDataBind() { DataTable dt = new DataTable(); dt.Columns.Add("id"); dt.Columns.Add("name"); dt.Columns.Add("location"); dt.Columns.Add("date"); if (dt.Rows.Count == 0) { dt.Rows.Add(dt.NewRow()); } this.GridView1.DataSource = dt; t 阅读全文
posted @ 2011-12-30 10:44 kuangkro 阅读(1734) 评论(2) 推荐(2)