We all know you can populate a ComboBox with an array like so:But what if you want the ComboBox to have both the DataValueField and DataTextField populated? The above method only populates the DataTextField.VB Code:
Dim arColours As New ArrayList(3) With arColours .Add("Black Magic Pearl") .Add("Imola Yellow") .Add("Jazz Blue") End With cboColour.DataSource = arColours cboColour.DataBind()
I only have 3 values that populate the ComboBox, and they are static, so it makes no sense to put them in a table and retrieve them into the ComboBox using a DataSet (the normal way to populate both fields).
Can it be done? Or am i outta luck?![]()




Reply With Quote