Displaying Data in Multiple Columns

You can render the contents of a DataList control into a multicolumn table in which each data item occupies a separate table cell. Two properties modify the layout of the HTML table rendered by the DataList control:

RepeatColumns The number of columns to display.

RepeatDirection The direction to render the cells. Possible values are Horizontal and Vertical.

For example, the page in Listing 13.8 displays the contents of the Movies database table in a three-column layout (see Figure 13.6).

Figure 13.6. Displaying a multicolumn DataList.

image

Listing 13.8. MultiColumnDataList.aspx

The DataList control in ...

Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.