DataGridView::AutoSizeRowsModeChanged Event
.NET Framework (current version)
Occurs when the value of the DataGridViewAutoSizeRowsMode property changes.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
For more information about handling events, see NIB: Consuming Events.
The following code example illustrates the use of this event. This example is part of a larger example available in How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control.
void WatchRowsModeChanges( Object^ /*sender*/, DataGridViewAutoSizeModeEventArgs^ modeEvent ) { Label^ label = dynamic_cast<Label^>(flowLayoutPanel1->Controls[ currentLayoutName ]); if ( modeEvent->PreviousModeAutoSized ) { label->Text = String::Format( "changed to a different {0}{1}", label->Name, dataGridView1->AutoSizeRowsMode ); } else { label->Text = String::Concat( label->Name, dataGridView1->AutoSizeRowsMode ); } }
.NET Framework
Available since 2.0
Available since 2.0
Show: