0

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

2
Contributors
1
Reply
3
Views
8 Years
Discussion Span
Last Post by abhishekcs
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.