tags:

views:

90

answers:

3

Is there a built-in grid that I could do the following simply:

SELECT * FROM MYTABLE

It would list all the rows, with paging support.

Allow me to update/delete/insert a row by double clicking on it and making it editable etc.

Does this exist? Does it require me to write any code to perform the CRUD operations?

(any version of ASP.NET is fine)

A: 

The GridView does this, in conjunction with Data Source Controls like the SqlDataSource control. "No code".

John Saunders
+2  A: 

Take a look at the ASP.NET QuickStart Tutorials. There's a tutorial on how to use the GridView for the purposes of adding data:

ASP.NET Quickstart Tutorials - GridView

The last example on that page demonstrates how to implement an updatable GridView with no code at all (with the exception of SQL statements).

To implement a simple 'insert data' feature, you should take a look at the following tutorial on the same site (scroll down to the last example):

ASP.NET Quickstart Tutorials: DetailsView

These should get you started.

HTH
Kev

Kev
A: 

In addition to that (in case you are OK with third-party ASP.NET grid solution), you may be interested in the Telerik grid which has a method from its client-side API that can switch directly a grid row in edit mode on dbl click. The control also supports automatic operations with ASP.NET 2.x or 3.x data source controls.

I use it for my web sites developement and I am pretty content with the results.Check out the NET 3.5 and Insert/Update/Delete sections from its online demos here.