DataGrid.Navigate-Ereignis
Tritt ein, wenn der Benutzer zu einer neuen Tabelle navigiert.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
Syntax
'Declaration
Public Event Navigate As NavigateEventHandler
'Usage
Dim instance As DataGrid
Dim handler As NavigateEventHandler
AddHandler instance.Navigate, handler
public event NavigateEventHandler Navigate
public:
event NavigateEventHandler^ Navigate {
void add (NavigateEventHandler^ value);
void remove (NavigateEventHandler^ value);
}
/** @event */
public void add_Navigate (NavigateEventHandler value)
/** @event */
public void remove_Navigate (NavigateEventHandler value)
JScript unterstützt die Verwendung von Ereignissen, aber nicht die Deklaration von neuen Ereignissen.
Hinweise
Mit dem Navigate-Ereignis können Sie individuelle Spalteneigenschaften, z. B. die Breite, entsprechend der Tabelle zurücksetzen.
Weitere Informationen zum Behandeln von Ereignissen finden Sie unter Behandeln von Ereignissen.
Beispiel
' Create an instance of the 'Navigate' NavigateEventHandler.
Private Sub CallNavigate()
AddHandler myDataGrid.Navigate, AddressOf Grid_Navigate
End Sub 'CallNavigate
' Raise the event when navigating to another table.
Private Sub Grid_Navigate(ByVal sender As Object, ByVal e As NavigateEventArgs)
' String variable used to show message.
Dim myString As String = "Navigate event raised, moved to another table"
' Show the message when navigating to another table.
MessageBox.Show(myString, "Table navigation information")
End Sub 'Grid_Navigate
// Instantiate the 'Navigate' NavigateEventHandler.
private void CallNavigate()
{
myDataGrid.Navigate += new NavigateEventHandler(Grid_Navigate);
}
// Raise the event when navigating to another table.
private void Grid_Navigate(object sender, NavigateEventArgs e)
{
// String variable used to show message.
string myString = "Navigate event raised, moved to another table";
// Show the message when navigating to another table.
MessageBox.Show(myString, "Table navigation information");
}
// Instantiate the 'Navigate' NavigateEventHandler.
private:
void CallNavigate()
{
myDataGrid->Navigate += gcnew NavigateEventHandler( this, &MyDataGrid::Grid_Navigate );
}
// Raise the event when navigating to another table.
private:
void Grid_Navigate( Object^ /*sender*/, NavigateEventArgs^ /*e*/ )
{
// String variable used to show message.
String^ myString = "Navigate event raised, moved to another table";
// Show the message when navigating to another table.
MessageBox::Show( myString, "Table navigation information" );
}
// Instantiate the 'Navigate' NavigateEventHandler.
private void CallNavigate()
{
myDataGrid.add_Navigate(new NavigateEventHandler(GridNavigate));
} //CallNavigate
// Raise the event when navigating to another table.
protected void GridNavigate(Object sender, NavigateEventArgs e)
{
// String variable used to show message.
String myString = "Navigate event raised, moved to another table";
// Show the message when navigating to another table.
MessageBox.Show(myString, "Table navigation information");
} //GridNavigate
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
DataGrid-Klasse
DataGrid-Member
System.Windows.Forms-Namespace