Evento DataRepeater.VirtualModeChanged

Ocorre quando o VirtualMode propriedade é alterada.

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

Sintaxe

'Declaração
Public Event VirtualModeChanged As EventHandler
public event EventHandler VirtualModeChanged
public:
 event EventHandler^ VirtualModeChanged {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
member VirtualModeChanged : IEvent<EventHandler,
    EventArgs>
JScript não oferece suporte a eventos.

Comentários

Use este evento para executar código quando o VirtualMode propriedade for alterada em tempo de execução.

Para obter mais informações sobre como manipular eventos, consulte Consumindo eventos.

Exemplos

O exemplo a seguir demonstra como manipular o VirtualModeChanged evento.

' If the DataRepeater is in virtual mode, 
' do not allow adds or deletes.
If DataRepeater1.VirtualMode = True Then
    DataRepeater1.AllowUserToAddItems = False
    DataRepeater1.AllowUserToDeleteItems = False
    ' Disable the Add button.
    ProductsBindingNavigator.AddNewItem.Enabled = False
    ' Disable the Delete button.
    ProductsBindingNavigator.DeleteItem.Enabled = False
End If
// If the DataRepeater is in virtual mode, 
// do not allow adds or deletes.
if (dataRepeater1.VirtualMode == true)
{
    dataRepeater1.AllowUserToAddItems = false;
    dataRepeater1.AllowUserToDeleteItems = false;
    // Disable the Add button.
    productsBindingNavigator.AddNewItem.Enabled = false;
    // Disable the Delete button.
    productsBindingNavigator.DeleteItem.Enabled = false;
}

Segurança do .NET Framework

Consulte também

Referência

DataRepeater Classe

Namespace Microsoft.VisualBasic.PowerPacks

VirtualMode

Outros recursos

Introdução ao controle DataRepeater (Visual Studio)

Modo virtual no controle DataRepeater (Visual Studio)