Occurs when the selected cell changes.
The following declaration shows the syntax for a method that handles the CurrentCellChange event.
[Visual Basic] Private Sub DataGridName_CurrentCellChange( _ ByVal sender As Object, _ ByVal e As EventArgs _ ) [C#] private void DataGridName_CurrentCellChange( object sender, EventArgs e ); [C++] private: void DataGridName_CurrentCellChange( Object* sender, EventArgs* e ); [JScript] private DataGridName_CurrentCellChange( sender : Object, e : EventArgs );
Property | Description |
---|---|
|
The following example prints the current row and column number using the CurrentCell property to return a DataGridCell.
[Visual Basic]
Private Sub DataGrid1_CurrentCellChange(ByVal sender As Object, ByVal e As System.EventArgs) Console.WriteLine(DataGrid1.CurrentCell.RowNumber) Console.WriteLine(DataGrid1.CurrentCell.ColumnNumber) End Sub
DataGrid Class | DataGrid MembersTopic | System.WinForms Namespace | DataGrid.CurrentCell | DataGridCell