DataRepeater.ItemsAdded Event
Occurs when a new DataRepeaterItem is added to a DataRepeater control.
Namespace: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Syntax
'Declaration
Public Event ItemsAdded As DataRepeaterAddRemoveItemsEventHandler
public event DataRepeaterAddRemoveItemsEventHandler ItemsAdded
public:
event DataRepeaterAddRemoveItemsEventHandler^ ItemsAdded {
void add (DataRepeaterAddRemoveItemsEventHandler^ value);
void remove (DataRepeaterAddRemoveItemsEventHandler^ value);
}
member ItemsAdded : IEvent<DataRepeaterAddRemoveItemsEventHandler,
DataRepeaterAddRemoveItemsEventArgs>
JScript does not support events.
Remarks
The ItemsAdded event is raised when a request is made to add a new item, before the new item is displayed. Use this event to retrieve the index for the new item from the DataRepeaterAddRemoveItemsEventArgs.
In virtual mode, this event occurs before the ItemValuePushed event and can be used to create new records in your data store that you can then populate in the ItemValuePushed event handler.
For more information about how to handle events, see Consuming Events.
Examples
The following example demonstrates how to retrieve the index for a new item in a DataRepeater control.
Private Sub DataRepeater1_ItemsAdded(
ByVal sender As Object,
ByVal e As Microsoft.VisualBasic.PowerPacks.DataRepeaterAddRemoveItemsEventArgs
) Handles DataRepeater1.ItemsAdded
MsgBox("New item: " & CStr(e.ItemIndex))
End Sub
private void dataRepeater1_ItemsAdded(object sender, Microsoft.VisualBasic.PowerPacks.DataRepeaterAddRemoveItemsEventArgs e)
{
string itemNumber;
itemNumber = e.ItemIndex.ToString();
MessageBox.Show("New item: " + itemNumber);
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualBasic.PowerPacks Namespace