Exemplo n.º 1
0
        public void fillData()
        {
            DataTable       dt      = daoNews.GetListByType(idType);;
            PagedDataSource pgitems = new PagedDataSource();

            System.Data.DataView dv = new System.Data.DataView(dt);
            pgitems.DataSource  = dv;
            pgitems.AllowPaging = true;
            pgitems.PageSize    = 20;
            if (PageNumber >= pgitems.PageCount)
            {
                PageNumber = 0;
            }
            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;
            }

            repeaterList.DataSource = pgitems;
            repeaterList.DataBind();
        }
Exemplo n.º 2
0
        protected void dllTypes_SelectedIndexChanged(object sender, EventArgs e)
        {
            PageNumber = 0;
            string idType = ddlTypes.SelectedValue.ToString();

            if (idType.Trim() != "")
            {
                DataSource = newDao.GetListByType(idType);
                fillData();
            }
            else
            {
                loadData();
            }
        }