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)

public event DataRepeaterAddRemoveItemsEventHandler ItemsAdded

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.

The following example demonstrates how to retrieve the index for a new item in a DataRepeater control.

private void dataRepeater1_ItemsAdded(object sender, Microsoft.VisualBasic.PowerPacks.DataRepeaterAddRemoveItemsEventArgs e)
    string itemNumber;
    itemNumber = e.ItemIndex.ToString();
    MessageBox.Show("New item: " + itemNumber);

Community Additions