DataListItem(Int32, ListItemType) Constructor

Definition

Initializes a new instance of the DataListItem class.

C#
public DataListItem(int itemIndex, System.Web.UI.WebControls.ListItemType itemType);

Parameters

itemIndex
Int32

The index of the item in the DataList control from the Items collection.

itemType
ListItemType

One of the ListItemType values.

Examples

The following example demonstrates how to create and initialize a new instance of the DataListItem class.

C#
void Page_Load(Object sender, EventArgs e)
{
   int index = 0;
   DataListItem myItem = new DataListItem(index, ListItemType.Item);
}

Remarks

Use this constructor to create and initialize a new instance of the DataListItem class.

Applies to

Produkt Verzie
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also