
04/11/2009, 17:54
|
 | | | Fecha de Ingreso: diciembre-2008
Mensajes: 149
Antigüedad: 16 años, 1 mes Puntos: 0 | |
Respuesta: Como hacer un "X" Control Box , implementar en un Button Salir ? En el evento cellvalidating() /// <summary>
/// Validacion de la entradas de datos
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void dataGridView_plan_cuotas_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
{
//Verifico que la entrada ingresada sean valores enteros
if (e.ColumnIndex==2 || e.ColumnIndex == 3)
{
this.dataGridView_plan_cuotas.Rows[e.RowIndex].ErrorText = "";
int newInteger;
if (!int.TryParse(e.FormattedValue.ToString(), out newInteger))
{
e.Cancel = true;
this.dataGridView_plan_cuotas.Rows[e.RowIndex].ErrorText = "Ingrese una Cantidad entera";
}
}//Se debe introducir una denominación para el plan ingresado
else if (e.ColumnIndex == 1)
{
if (String.IsNullOrEmpty(e.FormattedValue.ToString()) )
{
e.Cancel = true;
this.dataGridView_plan_cuotas.Rows[e.RowIndex].ErrorText = "Ingrese una Denominación para el Plan de Cuotas";
}
}
}
__________________ Looking for a terrific Persistence Layer and Business Objects system for Microsoft.NET? our blog for more details. http://www.entityspaces.net |