How to: Specify Horizontal or Vertical Layout in DataList Web Server Controls
By default, theWeb server control displays a single column. However, you can specify any number of columns. Within the columns, you can specify how the items are ordered: vertically (which is the default) or horizontally. Vertical layout in three columns results in a layout such as the following:
1 4 7 2 5 8 3 6
Horizontal layout for the same items results in the following layout:
1 2 3 4 5 6 7 8
To specify column count and ordering at design time
Set the DataList control'sproperty to the number of columns that you want.
Set theproperty to either or .
To specify column count and ordering programmatically
Specify the number of columns that want by using the RepeatColumns property, and then specify how you want the items in the columns to be ordered by using the RepeatDirection enumeration, as shown in the following code example.