System.Web.UI.WebControls Namespace DataList Class
Sets or retrieves a value indicating whether the rows of a Table control, defined in each template of a DataList control, are extracted and displayed.
Script |
DataList.ExtractTemplateRows [ = true | false ] |
This property accepts or returns only a boolean value: true if the rows of a Table control, defined in each template of a DataList control, are extracted and displayed; otherwise, false. Default value is false.
The contents of the DataList control are specified by using templates. Normally, you list controls that you want to display in the templates. You can also place a Table control in a template and display the rows of the table.
Use the ExtractTemplateRows property to specify whether the rows of a Table control defined in each template of a DataList control are extracted and displayed. All rows extracted from the templates of the DataList are displayed in a single table. This allows you to create a single table from other smaller tables and still maintain the features of the DataList.
NOTE: When this property is set to true, you must provide a well-formed Table control for each template you want to include in the DataList control. Only the rows of the tables will be displayed. All other content in the template will be ignored. You must use a Table control for this feature to work properly. The HtmlTable control is not compatible with this property.
When you create a cell for a Table control in a template, you can use the ColumnSpan and the RowSpan properties of the TableCell object to control the number of columns and the number of rows the cell spans.
NOTE: The RepeatColumns, RepeatDirection, and RepeatLayout properties do not affect the appearance of the DataList when this property is set.
The following example illustrates using the ExtractTemplateRows property.
Show me
DataList Members