Occurs when the CurrentItemIndex changes.
Assembly: Microsoft.VisualBasic.PowerPacks (in Microsoft.VisualBasic.PowerPacks.dll)
The following example demonstrates how to use the CurrentItem property to make changes when an item is selected. It assumes that you have a form that contains a bound DataRepeater named DataRepeater1, a bound TextBox named UnitsInStockTextBox, and a Label named LowStockWarningLabel.
Private Sub DataRepeater1_CurrentItemIndexChanged(ByVal sender _ As Object, ByVal e As System.EventArgs) Handles _ DataRepeater1.CurrentItemIndexChanged ' Exit if the control is first loading. If DataRepeater1.CurrentItem Is Nothing Then Exit Sub ' Check for zero or negative quantity. If _ CDbl(DataRepeater1.CurrentItem.Controls("UnitsInStockTextBox").Text) _ < 1 Then ' Display a the warning label on the form. Me.LowStockWarningLabel.Visible = True Else Me.LowStockWarningLabel.Visible = False End If End Sub
- 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.