title: How to Supply Default Value in DataGridView
body: <p>I need to find a way to supply a default value if the user leaves a cell blank in my datagridview. Right now I'm able to display an error message if the user leaves the cell blank but I also want to insert a default text in the cell after the message pops up. For example if the cell requires a name and the user leaves it blank, a message will pop up and tell the user that he/she cannot leave the name blank. After this I want the text "name" to populate the cell</p>
  
  <pre><code>If (e.ColumnIndex = 0) Then 'checking numeric value for column 1 only
  Dim cellData = DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value
   if cellData Is Nothing OrElse IsDBNull(cellData) OrElse cellData.ToString = String.Empty Then       
     MessageBox.Show("Please Enter a Value")
     Exit Sub
  </code></pre>
  
  <p>End If</p>