在RowDataBound中改变或设置Header和Footer
来源:互联网 发布:电厂环保怎样数据作假 编辑:程序博客网 时间:2024/06/08 16:20
- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.Footer)
- {
- e.Row.Cells[0].Text = "21";
- e.Row.Cells[1].Text = "All";
- e.Row.Cells[2].Text = "Total Dealers Status";
- //e.Row.Cells[4].Text = Convert.ToInt32(HidCount.Value).ToString("###,###");
- //e.Row.Cells[6].Text = Convert.ToDouble(HidSoldPrice.Value).ToString("C");
- e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Right;
- //e.Row.Cells[4].HorizontalAlign = HorizontalAlign.Right;
- //e.Row.Cells[6].HorizontalAlign = HorizontalAlign.Right;
- //e.Row.Cells[7].Text = DateTime.Now.ToString("yyyy-MM-dd");
- //e.Row.Cells[8].Text = DateTime.Now.ToString(@"HH:mm:ss G/MT zzz");
- }
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- e.Row.Cells[3].Attributes.Add("style", "vnd.ms-excel.numberformat: @");
- //e.Row.Cells[4].Attributes.Add("style", "vnd.ms-excel.numberformat: @");
- }
- if (e.Row.RowType == DataControlRowType.Header)
- {
- GridViewRow row = new GridViewRow(-1, -1, DataControlRowType.Header,
- DataControlRowState.Normal);
- TableCell cell1 = new TableCell();
- cell1.Text = "<b>Report:</b>";
- row.Cells.AddAt(0, cell1);
- TableCell cell2 = new TableCell();
- cell2.Text = "New Loans By Deal";
- row.Cells.AddAt(1, cell2);
- TableCell cell3 = new TableCell();
- cell3.Attributes["align"] = "right";
- cell3.Text = "<font style=/"text-align:right; font-
- weight:bold;/">Date/Time:</font>";
- row.Cells.AddAt(2, cell3);
- //TableCell cell4 = new TableCell();
- //cell4.Text = DateTime.Now.ToString("yyyy-MM-dd") + " " +
- DateTime.Now.ToString(@"HH:mm:ss");
- //row.Cells.AddAt(3, cell4);
- GridView1.Controls[0].Controls.AddAt(0, row);
- }
- }
- }
- 在RowDataBound中改变或设置Header和Footer
- [转]怎样在UICollectionView中添加Header和footer
- 怎样在UICollectionView中添加Header和footer
- 怎样在UICollectionView中添加Header和footer
- 同一header和footer使用在多个页面中
- 设置TableView的header和footer
- UITableView中Header和Footer悬停方式
- 20header和footer
- android ListView 设置header和footer的问题
- android ListView 设置header和footer的问题
- log4net在Header和Footer之后插入换行符
- 做listview+上下拉动在header和footer
- ListView中动态显示和隐藏Header&Footer
- storyBoard中给tableView添加header和footer
- ListView中动态显示和隐藏Header&Footer
- ListView中动态显示和隐藏Header&Footer(赞,取消)
- ReccylerView添加header和footer
- RecyclerView添加Header和Footer
- Svn1.4.6版本的安装与配置及基本用法
- 谷歌李开复:若碰到裁员 员工应当成一种动力
- vc代写程序
- 在Ubuntu环境下配置Birt开发环境
- 只允许某一组执行su -
- 在RowDataBound中改变或设置Header和Footer
- BW第一课 信息对象
- 浅谈脚本在界面库设计中的作用
- symbian 新手贡献搭建开发环境和运行helloworld经验
- 红色印章制作过程记录
- How to use AlertDialog.Builder in Android applications
- Windows 桌面应用脚本语言的选择
- 初探Lambda表达式
- 《Symbian OS:线程编程》