DataGrid.AllowNavigation プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGrid.AllowNavigation プロパティの意味・解説 

DataGrid.AllowNavigation プロパティ

移動できるかどうかを示す値を取得または設定します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Dim instance As DataGrid
Dim value As Boolean

value = instance.AllowNavigation

instance.AllowNavigation = value
public bool AllowNavigation { get;
 set; }
public:
property bool AllowNavigation {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_AllowNavigation ()

/** @property */
public void set_AllowNavigation (boolean value)
public function get AllowNavigation
 () : boolean

public function set AllowNavigation
 (value : boolean)

プロパティ
移動できる場合trueそれ以外場合false既定値true です。

解説解説

このプロパティfalse設定されている場合、子テーブルへのリンクは表示されません。

使用例使用例

AllowNavigation プロパティを、truefalse の間で切り替えるコード例次に示します

' Create an instance of the 'AllowNavigationChanged' EventHandler.
Private Sub CallAllowNavigationChanged()
   AddHandler myDataGrid.AllowNavigationChanged, AddressOf
 Grid_AllowNavChange
End Sub 'CallAllowNavigationChanged


' Set the 'AllowNavigation' property on click of a button.
 Private Sub myButton_Click(ByVal
 sender As Object, ByVal
 e As EventArgs)
     If myDataGrid.AllowNavigation = True Then
         myDataGrid.AllowNavigation = False
     Else
         myDataGrid.AllowNavigation = True
     End If
 End Sub 'myButton_Click
 
' Raise the event when 'AllowNavigation' property is changed.
 Private Sub Grid_AllowNavChange(ByVal
 sender As Object, ByVal
 e As EventArgs)
     Dim myString As String
 = "AllowNavigationChanged event raised, Navigation "
     Dim myBool As Boolean
 = myDataGrid.AllowNavigation
     ' Create appropriate alert message.
     myString = myString + IIF(mybool, "is", "is
 not") + "allowed"
     ' Show information about navigation.
     MessageBox.Show(myString, "Navigation information")
 End Sub 'Grid_AllowNavChange

// Create an instance of the 'AllowNavigationChanged' EventHandler.
private void CallAllowNavigationChanged()
{
   myDataGrid.AllowNavigationChanged += 
                                   new EventHandler(Grid_AllowNavChange);
}

// Set the 'AllowNavigation' property on click of a button.
private void myButton_Click(object sender,
 EventArgs e)
{
   if (myDataGrid.AllowNavigation == true)
      myDataGrid.AllowNavigation = false;
   else
      myDataGrid.AllowNavigation = true;
}

// Raise the event when 'AllowNavigation' property is changed.
private void Grid_AllowNavChange(object sender,
 EventArgs e)
{
   string myString = "AllowNavigationChanged event raised,
 Navigation ";
   bool myBool = myDataGrid.AllowNavigation;
   // Create appropriate alert message.
   myString = myString + (myBool ? " is " : " is not ") + "allowed";
   // Show information about navigation.
   MessageBox.Show(myString, "Navigation information");
}
private:
   // Create an instance of the 'AllowNavigationChanged' EventHandler.
   void CallAllowNavigationChanged()
   {
      myDataGrid->AllowNavigationChanged += gcnew EventHandler( this,
 &MyDataGrid::Grid_AllowNavChange );
   }

   // Set the 'AllowNavigation' property on click of a button.
private:
   void myButton_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      if ( myDataGrid->AllowNavigation == true
 )
            myDataGrid->AllowNavigation = false;
      else
            myDataGrid->AllowNavigation = true;
   }

   // Raise the event when 'AllowNavigation' property is changed.
private:
   void Grid_AllowNavChange( Object^ /*sender*/, EventArgs^ /*e*/
 )
   {
      String^ myString = "AllowNavigationChanged event raised, Navigation ";
      bool myBool = myDataGrid->AllowNavigation;

      // Create appropriate alert message.
      myString = String::Concat( myString, myBool ? (String^)" is " : "
 is not ", "allowed" );

      // Show information about navigation.
      MessageBox::Show( myString, "Navigation information" );
   }
// Create an instance of the 'AllowNavigationChanged' EventHandler.
private void CallAllowNavigationChanged()
{
    myDataGrid.add_AllowNavigationChanged(new EventHandler(
        GridAllowNavChange));
} //CallAllowNavigationChanged

// Set the 'AllowNavigation' property on click of a button.
protected void myButton_Click(Object sender,
 EventArgs e)
{
    if (myDataGrid.get_AllowNavigation() == true)
 {
        myDataGrid.set_AllowNavigation(false);
    }
    else {
        myDataGrid.set_AllowNavigation(true);
    }
} //myButton_Click

// Raise the event when 'AllowNavigation' property is changed.
protected void GridAllowNavChange(Object sender,
 EventArgs e)
{
    String myString = "AllowNavigationChanged event raised, Navigation ";
    boolean myBool = myDataGrid.get_AllowNavigation();

    // Create appropriate alert message.
    myString = myString + ((myBool) ? " is " : " is not " + "allowed");

    // Show information about navigation.
    MessageBox.Show(myString, "Navigation information");
} //GridAllowNavChange
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DataGrid.AllowNavigation プロパティ」の関連用語

DataGrid.AllowNavigation プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataGrid.AllowNavigation プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS