Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

DataRepeater.ItemValuePushed Event

Occurs when the VirtualMode property is set to True and the value of a child control in the DataRepeaterItem changes.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

public event DataRepeaterItemValueEventHandler ItemValuePushed

In virtual mode, use this event to save changes to the child control values to your data store.

When the VirtualMode property is set to False, this event is not raised.

For more information about how to handle events, see Consuming Events.

The following example demonstrates how to handle the ItemValuePushed event. It assumes that you have a DataRepeater control named DataRepeater1 that has its VirtualMode property set to True, and that you have a data store for a data source named Employees.

private void dataRepeater1_ItemValuePushed(object sender, Microsoft.VisualBasic.PowerPacks.DataRepeaterItemValueEventArgs e)
{
    Employee emp = Employees[e.ItemIndex];
    switch (e.Control.Name)
    {
        case "txtFirstName":
            emp.firstName = e.Control.Text;
            break;
        case "txtLastName":
            emp.lastName = e.Control.Text;
            break;
        default:
            MessageBox.Show("Error during ItemValuePushed unexpected control: " + e.Control.Name);
            break;
    }
}

Show:
© 2015 Microsoft