Comparison of DataGrid Repeater DataList
1.DATABIND () method Traces a record in a specific DataSource and establishes an entry and corresponding to the ITEM set of the data control. Each entry in the data control will become an instance of a class. This class is different from the different data controls. For example, each entry in the DataGrid is an instance of the DataGridItem class, and the entry in the Repeater is an instance of the REPEATERITEM class.
2. The reason why you use different classes to instantiate different data controls because different data controls will display data and corresponding HTML code in different ways. For example, the DataGridItem class inherits from the TableRow class, that is, every DataGridItem's instance can be seen as a line in a table. This is because DataGrid is designed to display data in the form of a
tag in HTML, so each record is a table. Repeater is designed to freely define data output. So, RepeaterItem does not inherit it is not surprising from TableRow.
3. The same point of another three data controls is that each control is allowed to use templates to display data. The DataList and Repeater controls must use templates to output data, while DataGrid allows only templates to display only templates (detailed discussion in DataGrod cells) through TemplateColumn.
4. The other is not very worthpassing: DataGrid and DataList are inherited from the WebControl class, while Repeater is inheriting from the Control class. The WebControl class contains some properties for beautification, such as Backcolor, Forecolor, CssClass, BorderStyle, and more. This shows that when using DataGrid or DataList, you can set these properties to personalize output. The Repeater control does not have these properties. We will discuss how to use templates to beautify the output of Repeater in the REATER unit.
4.DataGrid can be paid, sort, edit DataList has no paging, no sorting, editing template Repeater.
5.ASP.NET DataList Editing Template The use of DataList provides related editing templates, but with DataGrid is not the same, DataList does not edit buttons. To use the editing function in DataList. You can add a button in an item template, both of LinkButton and Button. Setting this button with the DataList's editing event in CommandName. Such as: CommandName = "Edit" Update button You can use the commandName = "Update" Cancel button to use CommandName = "delete" to be implemented using CommandName = "Delete". 6.ASP.NET Add Client Certificate Enter the Script code string in the page_load () event, such as: String myscript = "