asp.net.ph

DataListItem.ItemType Property

System.Web.UI.WebControls Namespace   DataListItem Class


Returns the type of an item in a DataList control.

Syntax


Script [ ListItemType variable = ] DataListItem.ItemType

Property Value


variable One of the ListItemType enum values.

The property is read only with no default value.

Remarks

Use the ItemType property to determine the type of a DataListItem in a DataList control.

Example

The following example demonstrates how to use the ItemType property to determine the type of an item in a DataList control. The order in which the items are positioned in the DataList is displayed along with the item type.


foreach ( DataListItem item in myDataList.Items ) {
   msg.Text += "<br>" + item.ItemIndex + " " + item.ItemType;
}
  C# VB

 Show me 

Below are links to further code examples that demonstrate use of the ItemType property in practical ASP.NET applications.

DataList ItemCreated Event Example
Run Sample | View Source
DataList ItemDataBound Event Example
Run Sample | View Source
See Also

DataListItem Members   ItemIndex Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph