Dim index As Integer ' find the location of the column index = Data Grid View1. Name = "Category" ' the column name (and heading) dgvc.Data Property Name = "Category ID" ' the matching column from the "base" table dgvc.
' Private Sub Data Grid View1_Row Validating(By Val sender As Object, By Val e As _ System. Row Validating ' Assume that text input is complete when you attempt to navigate ' away from the row Data Grid View1. In this case we're just checking to ' see if the Unit Price is a positive number If Data Grid View1. Luckily, the Data Grid View Combo Box Column control was designed to help solve this problem.
To determine when the cell contents are clicked, handle the Cell Content Click event.
This event does not receive information about the mouse position.
For example, if a user types in alpha characters (like "abc") into a numeric field, a data conversion error occurs before Row Validation.
In this case we need a "global" error checker to detect data conversion errors.