Click here to Skip to main content
15,891,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I've been able to change an individual datagridview cell to a combobox in my vb.net windows forms program. Now I'm hoping to find a way to change the entire column to a combobox. Here is my code to change the individual datagridview cells to combobox, the same approach should work but I haven't figured out how. I greatly appreciate any help or advice you may offer. :)

Dim myComboBoxCell As New DataGridViewComboBoxCell
       myComboBoxCell.Items.Add("A")
       myComboBoxCell.Items.Add("B")
       myComboBoxCell.Items.Add("C")
       DataGridView1(3, 0) = myComboBoxCell
Posted
Updated 14-Sep-13 14:25pm
v2

1 solution

Would something like this work for you?

VB
For cell As Integer = 1 to n
	Dim myComboBoxCell As New DataGridViewComboBoxCell
	DataGridView1(3, n) = myComboBoxCell    'Change as needed
Next cell
 
Share this answer
 
v2
Comments
CAS1224 15-Sep-13 11:26am    
Great way of thinking about it thanks!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900