Click here to Skip to main content
15,918,742 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

Has anyone found a solution that will allow me to have page numbers for paging in a data view web part. For instance, if I have 40 items/rows and I set the paging to display 10 items, I'd like the paging to show 1 2 3 4,along with buttons first next previous last buttons and when click on 10 for example then change from 10-20 with search box to jump to a particular page as well.

Can anyone provide me any reference articles and good in c# asp.net,advice highly appreciated.

Thanks
Posted

1 solution

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web.ASPxDataView;
using DevExpress.Web.ASPxPager;

public partial class DataView_EndlessPaging: System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {
        if(!IsPostBack)
            PrepareControls();
        if(IsCallback) {
            // Intentionally pauses server-side processing,
            // to demonstrate the Loading Panel functionality.
            System.Threading.Thread.Sleep(500);
        }
    }
    protected void cmbEndlessPagingMode_SelectedIndexChanged(object sender, EventArgs e) {
        DataViewEndlessPagingMode mode = (DataViewEndlessPagingMode)Enum.Parse(typeof(DataViewEndlessPagingMode), cmbEndlessPagingMode.Text);
        dataView.PagerSettings.EndlessPagingMode = mode;
    }
    void PrepareControls() {
        cmbEndlessPagingMode.Items.Add(Enum.GetName(typeof(DataViewEndlessPagingMode), DataViewEndlessPagingMode.OnClick));
        cmbEndlessPagingMode.Items.Add(Enum.GetName(typeof(DataViewEndlessPagingMode), DataViewEndlessPagingMode.OnScroll));
        cmbEndlessPagingMode.SelectedIndex = 0;
        dataView.PagerSettings.EndlessPagingMode = DataViewEndlessPagingMode.OnClick;
        dataView.PagerSettings.EllipsisMode = PagerEllipsisMode.None;
    }
}


See,
https://demos.devexpress.com/ASPxImageAndDataNavigationDemos/DataView/EndlessPaging.aspx[^]
http://blogs.msdn.com/b/cjwalker/archive/2005/05/28/422826.aspx[^]

-KR
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900