System.Web.UI.WebControls Namespace DataList Class
Sets or retrieves the number of columns to display in a DataList control.
Inline |
<asp:datalist repeatcolumns = intSize ... > |
Script |
DataList.RepeatColumns = intSize |
intSize |
The number of columns to display in the DataList control. |
The property is read/write with a default value of 1.
Use this property to specify the number of columns in which to display the items in the DataList control. For example, if you set this property to 3, the DataList displays its items in three columns.
NOTE: If this property is set to 0, the DataList displays its items in a single row or column, based on the value of the RepeatDirection property. If RepeatDirection is not set, or is set to Vertical, the items are displayed in a single column. If RepeatDirection is set to Horizontal, the items are displayed in a single row.
The following example demonstrates dynamically setting the RepeatColumns property of a DataList at run time, based on user input.
Show me
DataList Members RepeatDirection RepeatLayout