Esempio n. 1
0
    //Refreshes datalist
    protected void PopulateDataList()
    {
        pg = new PagedDataSource();
        ds = AudioFiles.GetAllFiles();
        if (ds.Tables[0].Rows.Count > 0)
        {
            pg.AllowPaging = true;
            pg.DataSource  = ds.Tables[0].DefaultView;

            pg.PageSize         = 5;
            pg.CurrentPageIndex = this.currentpage;
            this.ImageButtonNextPage.Enabled = !pg.IsLastPage;
            this.ImageButtonPrevPage.Enabled = !pg.IsFirstPage;
            DataList1.DataSource             = pg;
            DataList1.DataBind();
        }
    }