Introducing DotNetFunda.com on mobile http://m.dotnetfunda.com ! Be with DotNetFunda.com on the go !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 10215 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > ASP.NET Interview Questions > Difference between DataGrid, DataLsit an ...

Difference between DataGrid, DataLsit and Repeater?

Interview question and answer by: Syedshakeer | Posted on: 2/14/2009 | Category: ASP.NET Interview questions | Views: 4022 |


Answer:

Difference between DataGrid, DataLsit and Repeater?

DataGrid:

1) DataGird has a in-built Support for Sort, Filter, and Paging the Data.

2) Each Row in DataGrid is displayed as a row in the table.

3) It has an AutoGenarateColumn Property, which can be set to either True or False.
Default property is true.

4) DataGrid has predefined Editing Controls.

5)Following are the DataGrid Data Control Styles:

i. AlternatingItemStyle
ii. EditItemStyle
iii. FooterStyle
iv. HeaderStyle
v. ItemStyle
vi. SelectedItemStyle
vii. PagerStyle

6) Following are the DataGrid Data Control Templates(only supported by the TemplateColumna) :

i. HeaderTemplate
ii. ItemTemplate
iii. EditItemTemplate
iv. FooterTemplate



DataList:

1) Support Paging, Sorting and editing but explicitly code to do Paging.

2) It displays the Records in Tabular form.

3) By default the DataList Displays its Data in a HTML .

4) You can specify via the repeat columns how many DataSource records should appear HTML .

Eg :

5)DataList Doesnot have Predefined Editing Controls.


6) Following are the Data Grid Data Control Styles:

i. AlternatingItemStyle
ii. EditItemStyle
iii. FooterStyle
iv. HeaderStyle
v. ItemStyle
vi. SelectedItemStyle
vii. SeparatorStyle

7) Following are DataList Data Control Templates:

i. AleternatingItemTemplate
ii. EditItemTempalte
iii. HeaderTemplate
iv. ItemTempalte
v. SelectedItemTemplate
vi. SeparatorTemplate
vii. SelectedItemTemplate
viii. FooterTemplate

Repeater:

1) It can be used for lightweight and simple report generation.

2) It is used to display a Repeated List of items that are bound to the control.

3) It does not support Paging.

4) Repeater is faster followed by DataList and finally DataGrid.

5) To create a table in a Repeater you must include the begin table tag in the HeaderTemplate,a single table row tag in the ItemTemplate and the end table tag
in the FooterTemplate

6)No predefined Styles

7) Following are Repeater Data Control Templates:

i. FooterTemplate

Asked In: Many Interviews | Alert Moderator 
Found interesting? Add this to:


>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Syedshakeer

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/21/2012 8:58:48 AM