If (e.ColumnIndex = 2) Then 'checking value for column 2 only Dim cellData = DataGridViewC1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value.ToString If cellData <= 0 OrElse IsDBNull(cellData) OrElse cellData.ToString = String.Empty Then MessageBox.Show("Number Must Be Greater Than Zero") DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = "NA" End If End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)