DataGrid.Navigate Evento
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Ocorre quando o utilizador navega para uma nova tabela.
public:
event System::Windows::Forms::NavigateEventHandler ^ Navigate;
public event System.Windows.Forms.NavigateEventHandler Navigate;
member this.Navigate : System.Windows.Forms.NavigateEventHandler
Public Custom Event Navigate As NavigateEventHandler
Tipo de Evento
Exemplos
O seguinte exemplo de código demonstra a utilização deste elemento.
// 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.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");
}
' Create an instance of the 'Navigate' NavigateEventHandler.
Private Sub CallNavigate()
AddHandler myDataGrid.Navigate, AddressOf Grid_Navigate
End Sub
' 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
Observações
Use o Navigate evento para redefinir propriedades individuais das colunas, como a largura, conforme apropriado à tabela.