Sunday, October 26, 2008

what is the difference between GridView, DataList, ListView, Repeater, ListControl, DetailsView, FormView?

GridView:
(1)Can select one row to do something.
(3)update, delete records in database, but not insert
(4)Sort, paging
(5)Concurrency handling
(6)Display empty data
(7)Formatting (e.g. alternative row style)
(8)Customize field (e.g. use TemplateField to edit record)
(9)Extend (e.g. create LongTextField for GridView)

ListView:
(1) template driven
(2) can add data to database
(3) can edit, page through, sort database data
(4) ListView is the only control implementing IPageableItemContainer interface, so it is the only one which can use DataPager control.

ListView is the most flexible List control in all. I can safely use ListView in place of GridView.

Repeater:
(1) display database records. It cannot edit/insert records
(2) entirely template driven

DataList:
(1) display database records(can edit?)
(2) entirely template driven
DataList is very similar to Repeater except that DataList's default behavior is rending the content using a table. However, you can override the default behavior.

DetailsView:
(1) Display/edit/delete/Insert records in database
(2) Render a table for a single record. always render each field in a seperate table row.

FormView:
Exactly like DetailsView except that FormView is entirely template driven.

ListControl:
there are RadioButtonList, DropDownList, CheckBoxList, BulletedList, ListBox.

Refer: <>

6 comments:

Pravin Chimawekar said...

Thanks nice 1

Resham said...

Thnks. It helped a lot. : )

jay said...

Very nice summary. It helped lot. Thanks

Unknown said...
This comment has been removed by the author.
Unknown said...

i found this very informative thanks a lot for sharing

Unknown said...
This comment has been removed by the author.