Ejemplo n.º 1
0
        private void BindData()
        {
            PagedDataSource dt = new PagedDataSource();
            News currentnews = new News();
            currentnews.LoadAll();
            currentnews.DefaultView.Sort = "PostedDate desc";
            dt.DataSource = currentnews.DefaultView;
            dt.AllowPaging = true;
            dt.PageSize = 10;
            dt.CurrentPageIndex = PageIndex;
            uiRepeaterCurrentNews.DataSource = dt;
            uiRepeaterCurrentNews.DataBind();

            uiLinkButtonPrev.Enabled = !dt.IsFirstPage;
            uiLinkButtonNext.Enabled = !dt.IsLastPage;
            uiLabelPages.Text = "صفحة " + (PageIndex + 1).ToString() + " من " + dt.PageCount.ToString() + " صفحات";
        }
Ejemplo n.º 2
0
        private void BindData()
        {
            News objData = new News();

            objData.LoadAll();
            objData.DefaultView.Sort = "PostedDate Desc";
            uiGridViewNews.DataSource = objData.DefaultView;
            uiGridViewNews.DataBind();
        }