View Single Post
  #2 (permalink)  
Old September 4th, 2007, 03:57 AM
mike_remember mike_remember is offline
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

To do paging in datagrid, follow the steps below:

1. Set AllowPaging = true;
2. Set Pagesize to your desired one.
3. Now on grid's PageIndexChanged event, write the below (sample code I have written)

protected void dg_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
        {
            dg.CurrentPageIndex = e.NewPageIndex;

            //Method to bind the datagrid
            BindGrid();
        }

Regards
Mike

To the world you might be one person,
but for someone you might be the whole world.