当前位置: 首页 > news >正文

门户网站开发申请做网站乱码

门户网站开发申请,做网站乱码,网站代码图片,wordpress会员密码有效期GridView加入自动求和求平均值小计效果图#xff1a;解决方案#xff1a; private double sum 0; //取指定列的数据和#xff0c;你要根据具体情况对待可能你要处理的是int protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e){if (e.Row.R… GridView加入自动求和求平均值小计效果图解决方案 private double sum 0; //取指定列的数据和你要根据具体情况对待可能你要处理的是int protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e){if (e.Row.RowIndex 0){sum Convert.ToDouble(e.Row.Cells[6].Text);}else if (e.Row.RowType DataControlRowType.Footer){e.Row.Cells[5].Text 总薪水为;e.Row.Cells[6].Text sum.ToString();e.Row.Cells[3].Text 平均薪水为;e.Row.Cells[4].Text ((int)(sum / GridView1.Rows.Count)).ToString();}} 后台全部代码 using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; using System.Drawing; public partial class Default7 : System.Web.UI.Page {SqlConnection sqlcon;SqlCommand sqlcom;string strCon Data Source(local);Database北风贸易;Uidsa;Pwdsa;protected void Page_Load(object sender, EventArgs e){if (!IsPostBack){bind();}}protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e){GridView1.EditIndex e.NewEditIndex;bind();}protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e){sqlcon new SqlConnection(strCon);string sqlstr update 飞狐工作室 set 姓名 ((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString().Trim() ,家庭住址 ((TextBox)(GridView1.Rows[e.RowIndex].Cells[3].Controls[0])).Text.ToString().Trim() where 身份证号码 GridView1.DataKeys[e.RowIndex].Value.ToString() ;sqlcom new SqlCommand(sqlstr, sqlcon);sqlcon.Open();sqlcom.ExecuteNonQuery();sqlcon.Close();GridView1.EditIndex -1;bind();}protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e){GridView1.EditIndex -1;bind();}public void bind(){string sqlstr select top 5 * from 编程中国社区;sqlcon new SqlConnection(strCon);SqlDataAdapter myda new SqlDataAdapter(sqlstr, sqlcon);DataSet myds new DataSet();sqlcon.Open();myda.Fill(myds, 编程中国社区);GridView1.DataSource myds;GridView1.DataKeyNames new string[] { 身份证号码 };GridView1.DataBind();sqlcon.Close();}private double sum 0; //取指定列的数据和protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e){if (e.Row.RowIndex 0){sum Convert.ToDouble(e.Row.Cells[6].Text);}else if (e.Row.RowType DataControlRowType.Footer){e.Row.Cells[5].Text 总薪水为;e.Row.Cells[6].Text sum.ToString();e.Row.Cells[3].Text 平均薪水为;e.Row.Cells[4].Text ((int)(sum / GridView1.Rows.Count)).ToString();}} } 前台唯一的花头就是设置ShowFooterTrue 否则默认表头为隐藏的 asp:GridView IDGridView1 runatserver AutoGenerateColumnsFalse CellPadding3 OnRowEditingGridView1_RowEditingOnRowUpdatingGridView1_RowUpdating OnRowCancelingEditGridView1_RowCancelingEdit BackColorWhite BorderColor#CCCCCC BorderStyleNone BorderWidth1px Font-Size12px OnRowDataBoundGridView1_RowDataBound ShowFooterTrue FooterStyle BackColorWhite ForeColor#000066 /Columnsasp:CommandField HeaderText编辑 ShowEditButtonTrue /asp:BoundField DataField身份证号码 HeaderText编号 ReadOnlyTrue /asp:BoundField DataField姓名 HeaderText姓名 /asp:BoundField DataField出生日期 HeaderText邮政编码 /asp:BoundField DataField家庭住址 HeaderText家庭住址 /asp:BoundField DataField邮政编码 HeaderText邮政编码 /asp:BoundField DataField起薪 HeaderText起薪 //ColumnsRowStyle ForeColor#000066 /SelectedRowStyle BackColor#669999 Font-BoldTrue ForeColorWhite /PagerStyle BackColorWhite ForeColor#000066 HorizontalAlignLeft CssClassms-formlabel DataGridFixedHeader/HeaderStyle BackColor#006699 Font-BoldTrue ForeColorWhite //asp:GridView转载于:https://www.cnblogs.com/shangshen/p/3592197.html
http://www.yutouwan.com/news/99722/

相关文章:

  • ps里面怎么做网站对联广告百度下载并安装最新版
  • 做猎头可以在哪些网站注册电子商务网站课程设计总结
  • 音乐网站需求分析香烟网上商城
  • 网站管理员怎么联系自己怎么制作微信网页链接
  • 淘客网站如何做能加快收录良乡网站建设公司
  • 做外贸推广的网站正确的网线的顺序图
  • seo技术服务外包做seo是要先有网站吗
  • 做excel的网站太原住房和城乡建设部网站
  • 酒店网站建设的基本内容好看的网站ui
  • 成都网站开发 Vr网站建设第一步
  • 网站建设常用工具免费公司网站设计
  • 北京兼职做网站建设网站建设域名服务器
  • 超值高端网站设计如何做免费的网站推广
  • 上海南建设培训执业中心网站襄阳网络推广公司
  • 云南网站制作需求支付公司网站建设费账务处理
  • 哪里可以做公司网站做原型的网站
  • 猪八戒设计网站如何做兼职建设商务网站需要哪些步骤
  • 网站的关于我们怎么做wordpress运行php 404错误
  • 三拼域名做网站网站内容描述
  • 网站正在建设中 html5营销型网站建设的利与弊
  • 中国建设银行ie下载网站本地网站做不大
  • 电子商务网站建设的代码文字生成网址
  • seo怎么做网站排名微做网站
  • 河北提供网站建设公司哪家好江苏住房和城乡建设厅网站报考
  • 个人站长做网站如何做网站宣传片
  • 广州天河区网站设计公司wordpress目录图片
  • 代做网站转账截图怎么做祝福网站
  • 想做网站wordpress hotlink protection
  • 贵阳做网站好的公司有哪些WordPress面包屑主题
  • 北京丰台区网站建设公司做的网站怎么上传到网上