baabaa_nl
asked on
Fill datagridview combobox cell
Hi,
I am using vb.net.
I need a code to fill the combobox cell in a datagridview.
Thanks in advance.
I am using vb.net.
I need a code to fill the combobox cell in a datagridview.
Thanks in advance.
ASKER
i would like to add it programatically, and i would like to add a list of values manually from the code.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or, you can have the datasource set in the RowsAdded event of the datagridview by
Dim DataList As New List(Of String) From {"First Item", "Second Item", "Third Item"}
Dim xSender = DirectCast(sender, DataGridView)
CType(xSender.Rows(e.RowIndex).Cells(0), DataGridViewComboBoxCell).DataSource = DataList
Again, the code above assumes that the comboboxcolumn is the first column
What is the data that you'd want bound and where are you getting it from? (i.e SQL, List etc)