How to change a datagridview cell style from the default textbox to combobox in vb.net?
问题 I have a datagridview which is populated from a dataset. Once it is populated, if the user clicks on a row, the last column should change from textbox to combobox. I am using vb.net 2010. On the Datagridview1 CellClick event: With DataGridView1 If .Rows.Count = 0 Then Exit Sub i = Datagridview1.currentrow.index Dim gridComboBox As New DataGridViewComboBoxCell gridComboBox.Items.Add("A") 'Populate the Combobox gridComboBox.Items.Add("B") 'Populate the Combobox gridComboBox.Items.Add("C")