954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

DataGridView Combo box

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

shers
Junior Poster
116 posts since Aug 2007
Reputation Points: 8
Solved Threads: 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

abhishekcs
Newbie Poster
5 posts since Mar 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You