ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing

ExpertRating Home
ExpertRating Benefits
Recommend ExpertRating
Suggest More Tests
Privacy Policy
ASP Dot Net Tutorial - Index
ASP Dot Net Tutorial - Microsofts ASP.NET
ASP Dot Net Tutorial - Begining Web Forms
ASP Dot Net Tutorial - User Controls
ASP Dot Net Tutorial - ADO .NET
ASP Dot Net Tutorial - DataBinding to WebControls
ASP Dot Net Tutorial - DataList Controls
ASP Dot Net Tutorial - DataGrid Control
ASP Dot Net Tutorial - Advance Practical Examples on DataGrid
ASP Dot Net Tutorial - Working with DataSets
ASP Dot Net Tutorial - Working with XML
ASP Dot Net Tutorial - Forms Based Authentication
ASP Dot Net Tutorial - Windows Based Authentication

Online Personal Trainer Certification
Personal Trainer Certification (Spanish)
Six Sigma Certification
Find a Personal Trainer
Project Management Certification
Six Sigma Certification
Six Sigma Black Belt Certification
Master Black Belt Certification
Six Sigma Green Belt Certification
Life Coach Certification
Lean Management Certification
Lean Six Sigma Certification
First Aid Certification
CPR Certification
Yoga Certification
Aerobics Certification
Pilates Certification
Business Analyst Certification
SEO Certification
Online Business Writing Course & Certification
Makeup Artist Certification
Baby Sitting Course & Certification
Time Management Certification
Health Club Management Certification
Medical Coding Certification
Medical Billing Certification
Business Analysis Course
Master Trainer Certification
Total Quality Management Certification
Kaizen Certification
Creative Writing Certification
Event Management Certification
Test Search by Job Title
Administrative Assistant Certification
Virtual Assistant Certification
  All Online Courses


  Home > Courses, Tutorials & eBooks > ASP.NET Tutorial > Advance Practical Examples on DataGrid

ASP.NET Tutorial - Advance Practical Examples on DataGrid

                                                                                                                 Page 4 of 5

Paging Through Records in a DataGrid

The DataGrid control has a built-in support for paging through the records of a data source. This is an important feature because it helps to display huge data . Paging can be enabled only if a DataGrid control's data source implements the ICollection interface. This interface is not implemented by a DataReader, so a DataTable is used.

The following example demonstrates the Paging: -

The output of above example is shown below:

The DataGrid above displays five records at a time from the Titles database table.

By clicking the < and > links displayed at the bottom of the DataGrid, one page forward or backward can be moved.

The number of records displayed in a page is determined by the DataGrid control's PageSize property. By default, this property has the value 10. It is set to 4 in the listing to display fewer records per page.

A new page is selected with the dgrdTitles_PageIndexChanged subroutine. This subroutine assigns the value of the NewPageIndex to the DataGrid control's CurrentPageIndex. The subroutine then rebinds the DataGrid to the data source, displaying the new page of records. The appearance of the page links canbe controlled by modifying the properties of the DataGridPagerStyle object.



Home  |  About Us  |  Privacy Policy  |  Site Map  |  FAQs  |  Contact Us
© ExpertRating 2015. All Rights Reserved.