Private Sub MediaContentsDataGrid_EditingControlShowing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles MediaContentsDataGrid.EditingControlShowing 'Allow user to enter new values for ALL DataGridViewComboBox controls in the DataGridView If (TypeOf e.Control Is DataGridViewComboBoxEditingControl) Then Dim cmb As DataGridViewComboBoxEditingControl = CType(e.Control, DataGridViewComboBoxEditingControl) If Not cmb Is Nothing Then cmb.DropDownStyle = ComboBoxStyle.DropDown ' add handler for comboboxes to limit their text length AddHandler cmb.KeyPress, AddressOf ContentsDataGridViewComboBoxColumn_KeyPress_MaxLength End If End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)