Hi,

I have a DataGridView on a form that is being populated from a SQL table dataset by giving criteria from a previous form. I have 6 columns in the dataset, of which the last column should be combo box column containing items "Done" and "Pending". How do I make this bound column to a combo box column and display the value as well as the alternate item too in the combo box?

Thanks

i think u can try this

add a combobox from the datagridtasks by add column and select comboxcontrol from type,it will in the particuler column cell
and then try like this sample

With DataGridView1

' Set DataGridView Combo Column for CarID field

Dim ColumnCar As New DataGridViewComboColumn

' DataGridView Combo ValueMember field has name "CarID"

' DataGridView Combo DisplayMember field has name "Car"

With ColumnCar

.DataPropertyName = "CarID"

.HeaderText = "Car Name"

.Width = 80

' Bind ColumnCar to Cars table

.box.DataSource = ds.Tables("Cars")

.box.ValueMember = "CarID"

.box.DisplayMember = "Car"

End With

.Columns.Add(ColumnCar)

End With

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.