Sunday, March 8, 2009

Codeless sorting/paging GridView in

Please visit my new Web Site

Atfirst this post is only for beginner. Here i am introducing the most popular control in is GridView. A tremendous improvement over asp. Do you think that without writng a single line of code you can present a page with sorting & paging facility? Yes you can do it with few clicks just follow my below steps:

1) Modify your web.config file to write the connectionstring. Code should be:

add name="TestConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=TESTDB;Trusted_Connection=yes;" providerName="System.Data.SqlClient"/>

2) Add a SqlDataSource in your page & set the properties described in the following image to read data from your database.

3) Now add a GridView control & set the DataSource property to the SqlDataSource. Alos check the Enable paging, Enable sorting CheckBox. Now your page looks like below.

Now run your page & click on the header for sorting & click on the page number for paging. You can set the PageSize properties of GridView that how many rows you want to display in one page. In the following image my PageSize is 3.

Read the below link for simple almost codeless Insert, Delete & Update operation on GridView control:


Want to say something?

Want To Search More?
Google Search on Internet
Subscribe RSS Subscribe RSS
Article Categories
  • Gridview
  • Javascript
  • AJAX
  • Sql server
  • XML
  • CSS
  • Free Web Site Templates
  • Free Desktop Wallpapers
  • TopOfBlogs
    Free ASP.NET articles,C#.NET,VB.NET tutorials and Examples,Ajax,SQL Server,Javascript,Jquery,XML,GridView Articles and code examples -- by Shawpnendu Bikash