Problem with DataGridView formatting and default values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am rather unfamiliar with the DataGridView. I am trying to do a project
with VS2005 and SQL Server 2000. Assuming a DataGridView bound to a table,
what is the best place (best event) to catch new records and supply default
values? (Also assume that several of these fields do not permit nulls.)
 
The event is "DefaultValuesNeeded"

Example:
Private Sub DgViewAllCustomers_DefaultValuesNeeded(ByVal sender As Object,
ByVal e As System.Windows.Forms.DataGridViewRowEventArgs) Handles
DgViewAllCustomers.DefaultValuesNeeded
If ToggleUsingDefaultRowValue Then
e.Row.Cells("FirstName").Value = "Required"
e.Row.Cells("LastName").Value = "Can not be blank"
e.Row.Cells("SomeDate").Value = Today
End If
End Sub
 
Back
Top