asp.net.ph

DataListItem Class

System.Web.UI.WebControls Namespace


Represents an individual item in a DataList control.

DataListItem Class Members

Collapse   Constructors

Visibility Constructor Parameters
public DataListItem ( Int32 itemIndex , ListItemType itemType )

Collapse   Properties

Visibility Name Value Type Accessibility
public DataItem Object [ Get , Set ]
public ItemIndex Int32 [ Get ]
public ItemType ListItemType [ Get ]
public SupportsDisabledAttribute Boolean [ Get ]

Collapse   Methods

Visibility Name Parameters Return Type
protected CreateControlStyle ( ) Style
protected OnBubbleEvent ( Object source , EventArgs e ) Boolean
public RenderItem ( HtmlTextWriter writer , Boolean extractRows , Boolean tableLayout ) Void

Remarks

The DataList control stores its contents in basically two collections. These collections are exposed via the DataList.Controls and DataList.Items properties. Both properties return a collection of DataListItem objects that represent the individual items in the DataList, though the contents of the collections differ slightly.

DataList.Controls returns a ControlCollection object that contains every item in the DataList that is treated as a control, including the header and footer, while DataList.Items returns a DataListItemCollection that contains only the data-bound items in the control.

For example, in a DataList bound to a data source with three records, DataList.Controls will return a collection consisting of five DataListItem objects: one each for the header and footer, and one for each record ( or row of data ) in the data source. DataList.Items on the other hand will return a collection consisting of three DataListItem objects, each corresponding to a record ( or row of data ) in the data source.

You can use the DataListItem object to gain access to the properties of each item or control in the DataList, as well as the properties of the child controls associated with each item or control.

For examples illustrating use of this control, see the individual member types of this class.

See Also

DataList.Controls   DataList.Items 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