This documentation is archived and is not being maintained.

DataListItemEventArgs Constructor

Initializes a new instance of the DataListItemEventArgs class.

[Visual Basic]
Public Sub New( _
   ByVal item As DataListItem _
)
[C#]
public DataListItemEventArgs(
   DataListItem item
);
[C++]
public: DataListItemEventArgs(
   DataListItem* item
);
[JScript]
public function DataListItemEventArgs(
   item : DataListItem
);

Parameters

item
A DataListItem object that represents an item in the DataList control.

Remarks

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

When an instance of DataListItemEventArgs is created by a call to this constructor, the following property is initialized to the specified value.

Property Initial Value
Item The value of the item parameter.

Example

[Visual Basic, C#, C++] The following example demonstrates how to create and initialize a new instance of the DataListItemEventArgs class.

[Visual Basic] 
Sub Item_Created(sender As Object, e As DataListItemEventArgs)
    Dim item_arg As New DataListItemEventArgs(e.Item)
End Sub 'Item_Created

[C#] 
void Item_Created(Object sender, DataListItemEventArgs e) 
{
   DataListItemEventArgs item_arg = new DataListItemEventArgs(e.Item);
}
   

[C++] 
void Item_Created(Object* /*sender*/, DataListItemEventArgs* e) 
{
   DataListItemEventArgs* item_arg = new DataListItemEventArgs(e->Item);
}
   

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

DataListItemEventArgs Class | DataListItemEventArgs Members | System.Web.UI.WebControls Namespace

Show: