Torna al Thread

Private Sub DataGridView1_CellEndEdit(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEndEdit DataGridView1.Rows(e.RowIndex).ErrorText = String.Empty End Sub Private Sub DataGridView1_CellValidating(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellValidatingEventArgs) Handles DataGridView1.CellValidating If DataGridView1.Columns(e.ColumnIndex).Name = "numero" Or DataGridView1.Columns(e.ColumnIndex).Name = "lunghezza" Then If Not IsNumeric(e.FormattedValue.ToString()) Then MsgBox("Volore non valido") 'Oppure 'DataGridView1.Rows(e.RowIndex).ErrorText = "Il valore non è numerico" e.Cancel = True End If End If End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5