Difference between repeater, datalist, and gridview and Its Usage

Source: Internet
Author: User

The object hierarchy chart shows that repeater is the lightest and smallest control.It only inherits the functions of basic controls, including the ID attribute and subcontrol set. Datalist and DataGrid inherit the webcontrol function, including style and appearance attributes.
From the perspective of object model, repeater is the simplest control and the smallest data binding control,It has no appearance, nor any specific user interface. Repeater also supports templates. However, it does not support built-in style and appearance attributes. If you need full control of the page, using repeater is the most appropriate choice.
Datalist has the repeater function and supports visual control.It inherits the Appearance Features of webcontrol and adds style attributes to control the appearance of its child controls. Datalist also supports standard project operations, such as selection, editing, and deletion. Datalist is the most suitable option for generating a series of projects either horizontally or vertically.
The gridview control implements table style columns and rows.Similar to datalist, datalist also supports visual and style control. In addition to selecting and editing projects, gridview also supports operations on the entire set, including paging and sorting. The biggest difference between the gridview and datalist is that the gridview does not contain any template attributes, which means that the row of the project or table is not templated. However, by adding templatecolumn to a column, you can use the template in the column.
The following table summarizes the main functions of the list control:

At the same time, we cannot forget. the new data binding control listview and datapager provided by net 3.5 are a combination of DataGrid and repeater. It has both open templates of Repeater control and editing features of DataGrid Control. This is definitely a good thing that can interest you, because it provides you with a much richer layout method than javasird, and has all the features of the DataGrid. The listview control itself does not provide the paging function, but we can use another control-datapager to implement the paging feature. Putting the paging feature in another control alone brings us a lot of benefits. For example, we can let other controls use it, and for example, we can put it anywhere on the page. In essence, datapager is a control that extends the listview paging function.
Microsoft has provided us with so many useful controls that we have no reason not to use them. Of course, we should properly use these controls. Repeater must be the first choice for a pair of performance considerations when data is simply displayed. If you need to operate data, datalist (preferred) and gridview can both be used.
Of course,The combination of listview and datapager will certainly be a golden combination in development. It is a great control in terms of performance and function implementation.

Difference between repeater, datalist, and gridview and Its Usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.