How To Ideas | How To Articles | How To Tutorials


0

How To Allow Paging In GridView


You need to create paging in GridView while creating websites in ASP.NET. It is a very simple process. In this article, I will show you the easiest way using which you can enable Paging in GridView while creating websites. Note that, the pager row, in which we display the number of pages and current page, which is used for quick navigation between pages, automatically hides itself when only one page is there.

Introductions:

  1. Create a new website or open an existing one in Visual Studio.
  2. Add a GridView control to one of the pages in the website.
  3. Select the GridView Control and open its properties. If properties window is not there, then you can open it by hitting shortcut key “Ctrl + W, P” or by going to “View” menu and then “Properties Window”.
  4. Change the value for AllowPaging from False to True. This property is set to False by default.
    image
  5. Now Open its events window by clicking the lightening icon in the properties window.
    image
  6. Now double click on the PageIndexChanging which will create a new method       protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
  7. Add the following lines of code to that method
    GridView1.PageIndex = e.NewPageIndex;
    GridView1.DataBind();
  8. Now, you will be having paging enabled in your GridView and working fine.

Incoming search terms:

  • allow paging asp net gridview (1)
  • how to add pagination to grid view (1)
  • in paging databound serial number in gridview asp net (1)
Filed in: ASP.NET Tags: , , , , , , , , , , ,

Leave a Reply

Submit Comment



© 6582 How To Ideas. All rights reserved.
Proudly designed by Theme Junkie.