Description: The DataListItemEventArgs class is a member of the System.Web.UI.WebControls namespace in C#. It represents the data item event argument, which is used to pass the event arguments to the handlers when the DataList control raises the ItemCreated or the ItemDataBound event.
Code Examples: 1.
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { // Your code here } }
This code demonstrates how to use the DataListItemEventArgs object in the OnDataBound event of the DataList control. It checks the item type and performs an action if the item is a certain type.
This code shows how to use the DataListItemEventArgs object in the OnItemCreated event of the DataList control. It creates a new Label control and adds it to a placeholder control found in the DataList item.
Package/Library: System.Web.UI.WebControls (part of the System.Web.dll assembly)
C# (CSharp) System.Web.UI.WebControls DataListItemEventArgs - 60 examples found. These are the top rated real world C# (CSharp) examples of System.Web.UI.WebControls.DataListItemEventArgs extracted from open source projects. You can rate examples to help us improve the quality of examples.