VB.Net GridView Paging in ASP.Net

You can use the VB.Net code to bind the data items to GridView control and apply the paging functionality on them. GridView control's paging properties allow you to set the page size and enabling/disabling of the paging feature.

Paging Event Used

OnPageIndexChanging event is used in this sample to set the New Page Index of GridView control and re-bind the data using VB.net code to it according to the specified page index.

 

GridView Paging Properties

1. AllowPaging

2. PageSize

 

The AllowPaging property accepts the boolean value as true/false that enables or disables the auto paging feature of the ASP.Net gridview control. The PageSize property accepts a numeric value that enables you to set the number of records you want to display at one time. The paging generates the number of pages according the value specified for the PageSize property.

 

Try the sample below to understand the functionality of GridView paging created using VB.Net code:

 

ProductIDProduct NameUnits In StockPrice Per Unit
1Chai3918.0000
2Chang1719.0000
3Aniseed Syrup1310.0000
4Chef Anton's Cajun Seasoning5322.0000
5Chef Anton's Gumbo Mix021.3500
6Grandma's Boysenberry Spread12025.0000
7Uncle Bob's Organic Dried Pears1530.0000
8Northwoods Cranberry Sauce640.0000
9Mishi Kobe Niku2997.0000
10Ikura3131.0000
12345678
  • HIRE EzineASP.Net Developers