Thursday, September 15, 2011

GridView

GridView:
Displays the values of a data source in a table where each column represents a field and each row represents a record. The GridView control allows you to select, sort, and edit these items.
Working with GridView DataSource controls to display data:
GridView can be bind with any one of the following DataSource controls:
SqlDataSource
LinqDataSource
ObjectDataSource
XmlDataSource.
Without need to write any line of code directly one can directly bind the DataSource Controls to display the data in GridView. In the below examples we will work with SqlDataSource and ObjectDataSource controls.
1.       SqlDataSource:
2.      ObjectDataSource:
In general the ObjectDataSource control is used to bind the data from the business logic class. So, first we will take a look at how to create a class that can bind data to GridView.
Creating your Movie class:
Follow the steps to create the Movie Class:
1. Open visual studio, create a new Empty Web Site and save it in u r local directory with some name.
.
2.      Go to solution explorer add a new master page and then add a new content page.

No comments:

Post a Comment