Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (30.09 KB, 1 trang )
5.4 Display Data Using the Table Control
.NET has a number of controls available for displaying data. How do I know which
control to use to display data, and how do I use the Table control to display data?
Technique
When you're first deciding to list data on your Web forms, you have a few Web server
controls to choose from:
•
Table. This Web server control allows you to create a read-only table type display
of data. This control is not data bound, and it uses the TableColumn and
TableRow objects for creation.
•
Repeater. This control is used to display read-only lists. You can use hyperlinks
and program the ItemCommand event so that you can perform actions when items
are selected. You must use templates to format the display. Templates are
discussed in How-To 5.5, as is the Repeater control. This is a great control for
quick lists.
•
DataList. Using this control, you will use templates not only to display, but also to
select and edit data in the list.
•
DataGrid. By far, this is the most powerful of the controls. In addition, it gives you
the most control over manipulating data. You display, sort, edit, and use various
types of controls in each column. The last three How-Tos in this chapter
thoroughly cover the DataGrid control.
Anatomy of the Table Web Server Control