If you need to control the layout (like tables versus CSS versus whatever), when use a Repeater or ListView. Between the two, ListView gives you a lot more events and built-in commands for editing, selecting, inserting. Additionally paging and grouping functionality. A Repeater is extremely simple, it repeats a layout with the data. Since you're building the layout by hand, Listview and Repeater require more code.
GridView 是一个更新过的 DataGrid,所以几乎没有理由使用 DataGrid。当连接到标准 ASP.NET 数据源时,GridView 工作得非常好,但是限制您使用包含大量布局规则的表格布局。由于使用的是内置布局,GridView 需要的代码更少。
Indeed! I've blogged on the differences between the ASP.NET 4.0 data tools. Basically, gridviews are the most powerful way to present tabular information, whereas ListView controls are for more complicated displays of repeated data. If I were giving advice to an ASP.NET newbie, I'd tell them to learn gridviews inside out and ignore the other controls to begin with.
ListView 控件还使用模板来显示数据
additional templates that allow for more scenarios when working with your data. These templates include the 布局模板,群组模板,项目分离模板.
ListView 控件(不像数据列表和转发器)还隐式支持以下功能
使用数据源控件编辑、插入和删除数据
for each of these scenarios.
DataList 控件
DataList 控件使用 就像中继器一样控件。它为数据集中的每一行重复数据,
它根据定义的模板显示这些数据。 However,它显示定义的数据
在各种 HTML 结构中的模板中。这包括水平或垂直的选项
以及 it also allows you来设置数据应该如何重复,作为流或表的布局。
The DataList control does not automatically use a data source control to edit data. Instead,
它 提供命令事件中,您可以编写自己的代码为这些场景
启用这些事件后,将 Button 控件添加到其中一个模板中,并设置按钮的
属性设置为编辑、删除、更新或取消关键字
然后由 DataList 控件引发。
中继器控制
Repater 控件还使用模板来定义自定义绑定。但是,它不将数据显示为单个记录。相反,它按照您在模板中指定的方式重复数据行。这个
allows you to create a single row of data and have it repeat across your page.
Repater 控件是一个 只读模板,也就是说,它只支持 ItemTemplate。
It does not implicitly support editing, insertion, and deletion. You should consider one of the
other controls if you need this functionality, otherwise 你必须自己编写代码 for
the Repeater control.
The above Descriptions are from MCTS 考试70-515 Web 应用程序开发与 Microsoft.NET Framework 4 book.