System.Web.UI.WebControls Namespace DataList Class
Specifies whether the DataList items are displayed in a table or flow layout.
Inline |
<asp:datalist repeatlayout = enumValue ... > |
Script |
DataList.RepeatLayout = enumValue |
The property is read/write with a default value of Table.
Use the RepeatLayout property to specify whether the items in the DataList control are displayed in a table or inline with the document flow. If this property is not set, or is set to Table, the items in the list are rendered into an HTML <table> element. If this property is set to Flow, the items in the list are rendered as HTML <span> elements.
NOTE: The RepeatColumns property determines how many table columns or span elements are rendered for each row.
When the DataList control is displayed in a table, you can use the GridLines property to specify a grid line style.
For more information, see the RepeatLayout enumeration.
The following example demonstrates dynamically setting the RepeatLayout of a DataList at run time, based on user input.
Show me
DataList Members RepeatDirection RepeatColumns Specifying List Direction in a DataList Control