다음을 통해 공유


DataGrid.Navigate 이벤트

사용자가 새 테이블을 탐색할 때 발생합니다.

네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)

구문

‘선언
Public Event Navigate As NavigateEventHandler
‘사용 방법
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에서는 이벤트를 사용할 수 있지만 새로 선언할 수는 없습니다.

설명

Navigate 이벤트를 사용하여 Width와 같은 개별 열 속성을 테이블에 적절하게 다시 설정합니다.

이벤트 처리에 대한 자세한 내용은 이벤트 사용을 참조하십시오.

예제

' 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

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

참고 항목

참조

DataGrid 클래스
DataGrid 멤버
System.Windows.Forms 네임스페이스