Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Closed Points: 75 Time: 08:28 - Nov 01, 2007  

dustPuppy

what is the difference between datagrid and gridview in asp.net 2?

I'm looking for a quick overview of what enhancements the gridview brings to me as a asp.net developer being used to used the datagrid.
Is the conversion easy? What extras do we get with that?

Categories

Answer Discussion
Tutorials

 

rcastagna

Date:: Nov 07, 2007

Time:: 07:23

Hey, dust!

Hope you've been doing well...

The short answer is that the gridview has built-in control for sorting and paging where the datagrid required three poodles, a ring of fire and the sacrifice of a small child to get it to do those "routine" tasks.

For a more detailed accounting of the differences, take a look at http://msdn.microsoft.com/msdnmag/issues...

From personal experience, the gridview is more flexible, but it still carries a lot of "weight" as a trade-off for that flexibility. I've been doing a lot more with repeaters because they're smaller in overhead and still offer a good portion of the features a gridview has...unless I'm going to do sorting or paging. Then, mostly for the ease with the built-in features, I'm using the gridview.

Hope this helps!

Ric 

dustPuppy

Date:: Nov 08, 2007

Time:: 11:39

thanks for your input Ric, i can relate well to the ring of fire :)
i somehow thought there was "more" to it, but then again, having sorting and paging integrated and better than the datagrid is a good deal also...
here's the points...

kumar

Date:: Feb 11, 2009

Time:: 07:30

the link that you have sumbited is mindblowing dude ;)

tejasree

Date:: May 13, 2009

Time:: 00:18

Basic difference is there are additional columns in the Gridview control like BoundField, HyperLinkField, ButtonField, CommandField ImageField, and CheckBoxField.

jitendrakumarbs

Date:: Jan 26, 2010

Time:: 22:51

what is diffrence between data grid and grid view in asp .net

with regards
jitendra kumar

bhuvaashvin01

Date:: Feb 07, 2010

Time:: 23:51

1.Code requires to handle the SortCommand event and rebind grid required.
2.Code requires to handle the PageIndexChanged.
3.Need extensive code for update operation on data.
4.When compared to gridview less events supported.

GridView..
1.No code required.
2.No code required for PageIndexChanged.
3.Needs little code for update operation.
4.GridView supports events fired before and after database updates

aimee

Date:: Dec 29, 2010

Time:: 00:37

I really can’t understand why so many people complain about PC start-up slow problems, you only need a computer cleaner to handle all the problems, such as tuneup360.

angadasp

Date:: Oct 12, 2011

Time:: 01:11

The GridView control is the successor to the DataGrid and extends it in a number of ways. First, it fully supports data source components and can automatically handle data operations, such as paging, sorting, and editing, provided its bound data source object supports these capabilities. In addition, the GridView control offers some functional improvements over the DataGrid. In particular, it supports multiple primary key fields and exposes some user interface enhancements and a new model for handling and canceling events.
The ASP.NET 1.x DataGrid control requires you to write a lot of custom code to handle common operations such as paging, sorting, editing, and deleting data. For example, while the DataGrid control can raise events when the user clicks to save or cancel changes, it doesn't offer much more than that. If you want to store changes to a persistent medium, such as a database, you have to handle the UpdateCommand event yourself, retrieve changed values, prepare a SQL command, and then proceed from there to commit the update.

ASP.NET 2.0 enhances the data-binding architecture, introducing a new family of components—the data source objects—which act as a bridge between data-bound controls and ADO.NET objects. These source objects promote a slightly different programming model and provide for new features and members. For data reporting purposes, your ASP.NET 2.0 applications should use the newest grid control—the GridView. The familiar DataGrid control is still supported, but it doesn't take full advantage of the specific capabilities of data source components.

Question Answered

This question has been closed, and points have been rewarded to the following experts:


rcastagna: 75

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

No tutorials have been submitted yet. Want to be the first?

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10279

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es