Exemplo n.º 1
0
 protected void LoadData()
 {
     QuiTrinhDAO qtdao = new QuiTrinhDAO();
     DataTable dt = new DataTable();
     dt = qtdao.DSQuiTrinh();
     PagedDataSource pgitems = new PagedDataSource();
     System.Data.DataView dv = new System.Data.DataView(dt);
     pgitems.DataSource = dv;
     pgitems.AllowPaging = true;
     pgitems.PageSize = 15;
     pgitems.CurrentPageIndex = PageNumber;
     if (pgitems.PageCount > 1)
     {
         rptPages.Visible = true;
         System.Collections.ArrayList pages = new System.Collections.ArrayList();
         for (int i = 0; i < pgitems.PageCount; i++)
             pages.Add((i + 1).ToString());
         rptPages.DataSource = pages;
         rptPages.DataBind();
     }
     else
         rptPages.Visible = false;
     rpTinTuc.DataSource = pgitems;
     rpTinTuc.DataBind();
 }