DataGridViewRowCancelEventArgs::Row Property
.NET Framework (current version)
Gets the row that the user is deleting.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The following code example illustrates the use of this type. This example is part of a larger example available in How to: Implement Virtual Mode in the Windows Forms DataGridView Control.
void dataGridView1_UserDeletingRow( Object^ /*sender*/, System::Windows::Forms::DataGridViewRowCancelEventArgs^ e ) { if ( e->Row->Index < this->customers->Count ) { // If the user has deleted an existing row, remove the // corresponding Customer object from the data store. this->customers->RemoveAt( e->Row->Index ); } if ( e->Row->Index == this->rowInEdit ) { // If the user has deleted a newly created row, release // the corresponding Customer object. this->rowInEdit = -1; this->customerInEdit = nullptr; } }
.NET Framework
Available since 2.0
Available since 2.0
Show: