DataGrid::AllowNavigation Property
.NET Framework (current version)
Gets or sets a value indicating whether navigation is allowed.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Property Value
Type: System::Booleantrue if navigation is allowed; otherwise, false. The default is true.
If this property is set to false, links to child tables are not shown.
The following code example toggles the AllowNavigation property between the true and false.
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" ); }
.NET Framework
Available since 1.1
Available since 1.1
Show: