Difference between ASP.NET Data Controls

Totally lame post, but I’m studying for my MCTS and thought this might help some one. Keep in mind the values in the matrices below are for out of the box ASP.NET – it doesn’t mean you can’t achieve certain functionality, by extending them.

Single Item Display

FormView

Property Value
Multiple Items No
Templated Yes
Create Yes
Read Yes
Update Yes
Delete Yes
Sorting No. It is a single item view, so there is no need.
Pagination Yes, but it’s only one page at a time. Use the AllowPaging=”true” attribute to turn it on. Use the PagerSettings-Mode attribute to state the type (NextPrevious, NextPreviousFirstLast, Numeric, NumericFirstLast). Use the PagerSettings element within the FormView to specify paging options such as the text for the previous and next buttons.

References:
http://msdn.microsoft.com/en-us/library/ms227992.aspx

DetailsView

Property Value
Multiple Items No
Templated No
Create Yes
Read Yes
Update Yes
Delete Yes
Sorting No. It is a single item view, so there is no need.
Pagination Yes, but it’s only one page at a time. Use the AllowPaging=”true” attribute to turn it on. Use the PagerSettings-Mode attribute to state the type (NextPrevious, NextPreviousFirstLast, Numeric, NumericFirstLast). Use the PagerSettings element within the FormView to specify paging options such as the text for the previous and next buttons.

References:
http://msdn.microsoft.com/en-us/library/s3w1w7t4.aspx

Multiple Item Display

Repeater

Property Value
Multiple Items Yes
Templated Yes
Create No
Read Yes
Update No
Delete No
Sorting No
Pagination No

References:
http://msdn.microsoft.com/en-us/library/x8f2zez5.aspx

ListView

Property Value
Multiple Items Yes
Templated Yes
Create Yes
Read Yes
Update Yes
Delete Yes
Sorting Yes. You add a LayoutTemplate and set the button’s command name to “Sort”. Set the CommandArgument to the direction that you want sorting.
Pagination Yes, use the DataPager control

References:
http://msdn.microsoft.com/en-us/library/bb398790.aspx

DataList

Property Value
Multiple Items Yes
Templated Yes, but it does wrap the output in a table.
Create No
Read Yes
Update Yes
Delete Yes
Sorting Yes, but you have to take care of this manually in your code behind.
Pagination Yes, but you have to take care of this manually in your code behind.

References:
http://msdn.microsoft.com/en-us/library/es4e4e0e.aspx

References:
http://msdn.microsoft.com/en-us/library/bb398790.aspx

GridView

Property Value
Multiple Items Yes
Templated No
Create Yes
Read Yes
Update Yes
Delete Yes
Sorting Yes
Pagination Yes

References:
http://msdn.microsoft.com/en-us/library/2s019wc0.aspx

Advertisements

3 thoughts on “Difference between ASP.NET Data Controls

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s