Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

populating combo box 1

Status
Not open for further replies.

dinster

Programmer
Apr 12, 2007
54
0
0
GB
hi everyone i've managed to be able to put a combo box on the grid.

i used this site and it was quite helpful



how do i use the combo to look up the values in a table currently its using a string?

'ComboBox Column
Dim Items() As String = {"Yes", "No", "Maybe"}
'Dim Filldrugs() As String
Dim cs5 As New CGridComboBoxStyle("Drug_ID", 60, HorizontalAlignment.Left, _
"DrugName", "No", _
Items, ComboBoxStyle.DropDownList)
CGrid.AddColumn(ts, cs5)

Basically i would like the combobox to use an access table called drugs and then fill the combo box when done at runtime?

can someone help me to do this? even an example will do?
 
Just set the DataSource, ValueMember and DisplayMember properties of the combo column to a DataTable populated from the Access table. Make sure that the ValueMember matches the underlying DataGridView datasource column so that a change in the combo is correctly applied to the grid datasource.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top