Advantages: griview is the most powerful. It provides many functions such as paging, editing, deletion, and selection. It is the most convenient to use and can be dragged directly to the page to create a new data source, after a few clicks, you can maintain the browsing, deletion, and modification of a table, and the page is displayed. (I haven't figured out how to click a few mouse clicks. If you know, please let me know .). In addition, it is not easy to customize templates and control them flexibly.
Disadvantage: it occupies a large amount of system resources. Its paging function retrieves the data of the entire table and returns it to the page on the gridview. Therefore, if the data volume is large, the speed is very slow. Low efficiency.
Datalist has better control styles .. No built-in pages .. Editing .. You have to hand it by yourself ..
There is also a repeater
Advantages: simple functions, high efficiency, easy and flexible control of generated HTML code, paging needs to be implemented by yourself, overall, if you are used to repeater will like it, suitable for foreground use.
Datalist is between them
When to use depends on your own program ..
Second person:
To put it simply: In the GridView, DataList is derived from WebControl and has the WebControl style attribute. DataList is parsed as a table, and each row is parsed as tr-td,
The Repeater is derived from Control and only repeats the content in the template. This is why the repeater does not provide ItemStyle, SelectItemTemplate, and style Control.
In terms of flexibility, the Repeater must be more flexible. It just loops the content and does not need to generate a series of spam code specified by. net, but at the same time, it also loses some of the features provided by. net. However, the html generated by compilation is simpler, so the efficiency is relatively high.
In terms of usage, it depends on which one you are better at using. Repeater is easier to set styles, and GridView is easier to add, delete, modify, and perform other operations.