Share via


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)

Syntax

'Declaration
Public Event ItemValuePushed As DataRepeaterItemValueEventHandler
'Usage
Dim instance As DataRepeater 
Dim handler As DataRepeaterItemValueEventHandler 

AddHandler instance.ItemValuePushed, handler
public event DataRepeaterItemValueEventHandler ItemValuePushed
public:
 event DataRepeaterItemValueEventHandler^ ItemValuePushed {
    void add (DataRepeaterItemValueEventHandler^ value);
    void remove (DataRepeaterItemValueEventHandler^ value);
}
JScript does not support events.

Remarks

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.

Examples

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 Sub DataRepeater1_ItemValuePushed(ByVal sender As Object, _
 ByVal e As  _
 Microsoft.VisualBasic.PowerPacks.DataRepeaterItemValueEventArgs) _
 Handles DataRepeater1.ItemValuePushed
    Dim emp As Employee = Employees.Item(e.ItemIndex)
    Select Case e.Control.Name
        Case "txtFirstName"
            emp.firstName = e.Control.Text
        Case "txtLastName"
            emp.lastName = e.Control.Text
        Case Else
            MsgBox("Error during ItemValuePushed unexpected control: " + e.Control.Name)
    End Select 
End Sub
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;
    }
}

.NET Framework Security

See Also

Reference

DataRepeater Class

DataRepeater Members

Microsoft.VisualBasic.PowerPacks Namespace

ItemValueNeeded

NewItemNeeded

Other Resources

Introduction to the DataRepeater Control (Visual Studio)

Virtual Mode in the DataRepeater Control (Visual Studio)