DataGridView.RowHeightChanged (Evento)
Actualización: noviembre 2007
Se produce cuando cambia el valor de la propiedad Height para una fila.
Ensamblado: System.Windows.Forms (en System.Windows.Forms.dll)
Para obtener más información sobre la forma de controlar eventos, vea Utilizar eventos.
En el ejemplo de código siguiente se muestra el uso de este evento. Este ejemplo forma parte de un ejemplo más extenso proporcionado en Cómo: Personalizar la apariencia de las filas en el control DataGridView de formularios Windows Forms.
// Adjusts the padding when the user changes the row height so that // the normal cell content is fully displayed and any extra // height is used for the content that spans multiple columns. void dataGridView1_RowHeightChanged(object sender, DataGridViewRowEventArgs e) { // Calculate the new height of the normal cell content. Int32 preferredNormalContentHeight = e.Row.GetPreferredHeight(e.Row.Index, DataGridViewAutoSizeRowMode.AllCellsExceptHeader, true) - e.Row.DefaultCellStyle.Padding.Bottom; // Specify a new padding. Padding newPadding = e.Row.DefaultCellStyle.Padding; newPadding.Bottom = e.Row.Height - preferredNormalContentHeight; e.Row.DefaultCellStyle.Padding = newPadding; }
Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.