All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
实例:ASP.NET遍历配置文件的连接字符串_[Asp.Net教程]
SQL中HAVING从句的用法_[SQL,Server教程]
Redhat,Linux,AS4下的LAMP与Discuz安装_php资料_编程技术
Linux系统下Apache服务器设置与优化_php资料_编程技术
防止刷新网页,自动跳回到页面顶部的办法_[Asp.Net教程]
asp.net2.0中web用户控件的概述与优点
初谈ADO.NET中利用DataAdapter进行数据操作_[Asp.Net教程]
SQL,Server,7.0,入门(二)_mssql学习_编程技术
PHP-Nuke存在远程SQL注入漏洞,后台数据库堪忧_php资料_编程技术
ASP.NET随机码生成示例_[Asp.Net教程]
Reading number is top 10 pictures
[猫扑大杂烩]华东师范墙上看到的捐精告示 15毫升3600元
9.3阅兵全景图4-陸海空现代化兵种方阵梯队
The real super beauty3
张家界的玻璃桥
Female model behind the bitterness, often being overcharged5
India's national beauty of the college students
宝贝系列
Sora aoi on twitter5
2012 national geographic daily picture5
哥斯达黎加的门将是如何练成的
Download software ranking
asp.netWeb服务器高级编程
Sora aoi 120 minutes
Unix video tutorial5
WebService在.NET中的实战应用教学视频 → 第1集
WebService在.NET中的实战应用教学视频 → 第4集
The cock of the Grosvenor LTD handsome
Ashlynn Video1
Proficient in Eclipse
Boxer's Top ten classic battle3
matrix3
归海一刀 published in(发表于) 2014/1/30 1:22:58 Edit(编辑)
asp.net的GridView控件使用大全_[Asp.Net教程]

asp.net的GridView控件使用大全_[Asp.Net教程]

asp.net的GridView控件使用大全_[Asp.Net教程]
GridView控件是asp.net开发中经常用到的控件之一,本网页设计教程详细介绍GridView的使用方法。

前台.aspx




 
|< 
< 
> 
>| 
      OnSelectedIndexChanged="ddlPage_SelectedIndexChanged">
      10
     15
      20
      30




后台  #region分页

protected void BindFollowExamInfoGridView(int PersonID)
  {
    int currentpage = Convert.ToInt32(lblPage.Text);
    DataTable dt = new DataTable();
    dt = feibf.GetByPersonIDFollowExamInfo(PersonID);  //查询指定人的随访信息记录
    if (dt.Rows.Count > 0)
    {
      FollowExamInfoGridView.DataSource = dt;
      FollowExamInfoGridView.DataBind();
      PagedDataSource ps = new PagedDataSource();
      ps.DataSource = dt.DefaultView;
      ps.AllowPaging = true;
      ps.PageSize = Convert.ToInt32(ddlPage.SelectedValue);
      lblPageCount.Text = ps.PageCount.ToString();
      this.lblPreButton.Enabled = true;
      this.lblNextButton.Enabled = true;
      ps.CurrentPageIndex = currentpage - 1;
      if (currentpage == 1)
      {
        this.lblPreButton.Enabled = false;
        this.lblFirstButton.Enabled = false;
      }
      else
      {
        this.lblPreButton.Enabled = true;
        this.lblFirstButton.Enabled = true;
      }
      if (currentpage == ps.PageCount)
      {
        this.lblNextButton.Enabled = false;
        this.lblLastButton.Enabled = false;
      }
      else
      {
        this.lblNextButton.Enabled = true;
        this.lblLastButton.Enabled = true;
      }
      FollowExamInfoGridView.DataSource = ps;
      FollowExamInfoGridView.DataBind();
    }
    
  }
  protected void lblPreButton_Click(object sender, EventArgs e)
  {
    this.lblPage.Text = Convert.ToString(Convert.ToUInt32(lblPage.Text) - 1);
    BindFollowExamInfoGridView(Convert.ToInt32(Request.QueryString["PersonID"]));
  }
  protected void lblNextButton_Click(object sender, EventArgs e)
  {
    this.lblPage.Text = Convert.ToString(Convert.ToUInt32(lblPage.Text) + 1);
    BindFollowExamInfoGridView(Convert.ToInt32(Request.QueryString["PersonID"]));
  }
  protected void lblFirstButton_Click(object sender, EventArgs e)
  {
    this.lblPage.Text = "1";
    BindFollowExamInfoGridView(Convert.ToInt32(Request.QueryString["PersonID"]));
  }
  protected void lblLastButton_Click(object sender, EventArgs e)
  {
    this.lblPage.Text = lblPageCount.Text;
    BindFollowExamInfoGridView(Convert.ToInt32(Request.QueryString["PersonID"]));
  }
  protected void ddlPage_SelectedIndexChanged(object sender, EventArgs e)
  {
    lblPage.Text = "1";
    BindFollowExamInfoGridView(Convert.ToInt32(Request.QueryString["PersonID"]));
  }
#endregion



添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.