DataGrid.BackButtonClick Event
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the Back
button on a child table is clicked.
public:
event EventHandler ^ BackButtonClick;
C#
public event EventHandler BackButtonClick;
member this.BackButtonClick : EventHandler
Public Custom Event BackButtonClick As EventHandler
The following code example adds an event handler for the BackButtonClick event.
// Create an instance of the 'BackButtonClick' EventHandler.
private:
void CallBackButtonClick()
{
myDataGrid->BackButtonClick += gcnew EventHandler( this, &MyDataGrid::Grid_BackClick );
}
// Raise the event when 'BackButton' on child table is clicked.
void Grid_BackClick( Object^ /*sender*/, EventArgs^ /*e*/ )
{
// String variable used to show message.
String^ myString = "BackButtonClick event raised, showing parent table";
// Show information about Back button.
MessageBox::Show( myString, "Back button information" );
}
C#
// Create an instance of the 'BackButtonClick' EventHandler.
private void CallBackButtonClick()
{
myDataGrid.BackButtonClick += new EventHandler(Grid_BackClick);
}
// Raise the event when 'BackButton' on child table is clicked.
private void Grid_BackClick(object sender, EventArgs e)
{
// String variable used to show message.
string myString = "BackButtonClick event raised, showing parent table";
// Show information about Back button.
MessageBox.Show(myString, "Back button information");
}
' Create an instance of the 'BackButtonClick' EventHandler.
Private Sub CallBackButtonClick()
AddHandler myDataGrid.BackButtonClick, AddressOf Grid_BackClick
End Sub
' Raise the event when 'BackButton' on child table is clicked.
Private Sub Grid_BackClick(ByVal sender As Object, ByVal e As EventArgs)
' String variable used to show message.
Dim myString As String = "BackButtonClick event raised, showing parent table"
' Show information about Back button.
MessageBox.Show(myString, "Back button information")
End Sub
The Back
button becomes visible when a child table is displayed. Clicking the button will cause the grid to display the parent table.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0 |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: