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