Paging

Discussion in 'ASP .Net Datagrid Control' started by hoz, Nov 5, 2004.

  1. hoz

    hoz Guest

    Hi ,
    I use a procedure to get list of all users and show them in a
    datagrid/datalist/etc.. with SqlDataReader . How can i list X item (lets
    say 50) on the first page , 2. 50 on second page and so on
     
    hoz, Nov 5, 2004
    #1
    1. Advertising

  2. hoz wrote:
    > I use a procedure to get list of all users and show them in a
    > datagrid/datalist/etc.. with SqlDataReader . How can i list X item (lets
    > say 50) on the first page , 2. 50 on second page and so on


    Hoz, see:

    An Extensive Examination of the DataGrid Web Control: Part 15
    http://aspnet.4guysfromrolla.com/articles/070903-1.aspx

    It looks at how to implement Default paging in a DataGrid. I discuss
    how to implement custom paging in my book, ASP.NET Data Web Controls
    Kick Start [http://www.4guysfromrolla.com/ASPScripts/Goto.asp?ID=148]

    Happy Programming!

    --

    Scott Mitchell

    http://www.4GuysFromRolla.com

    * When you think ASP.NET, think 4GuysFromRolla.com!
     
    Scott Mitchell [MVP], Nov 5, 2004
    #2
    1. Advertising

  3. hoz

    Scott M. Guest

    Turn on the Paging feature of the DataGrid (right click the grid, and choose
    Property Builder). Then in the PageIndexChanged event handler for the grid
    add:

    dg.CurrentPageIndex = e.NewPageIndex
    dg.DataBind()


    "hoz" <> wrote in message
    news:ebsj%...
    > Hi ,
    > I use a procedure to get list of all users and show them in a
    > datagrid/datalist/etc.. with SqlDataReader . How can i list X item (lets
    > say 50) on the first page , 2. 50 on second page and so on
    >
    >
     
    Scott M., Nov 5, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yangtsi River

    using Paging in Datagrid

    Yangtsi River, Jul 9, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    342
    Benjie Fallar
    Jul 9, 2003
  2. Saravana

    Re: Custom paging

    Saravana, Jul 10, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    420
    Saravana
    Jul 10, 2003
  3. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    DataSet paging vs Datareader paging

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 8, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    10,706
    Scott Allen
    Oct 8, 2004
  4. wh1974
    Replies:
    0
    Views:
    2,439
    wh1974
    Jan 12, 2005
  5. Red
    Replies:
    1
    Views:
    725
Loading...

Share This Page