Is it possible to populate a ComboBox using the Columns property of a dataview? If so how? :confused:
Printable View
Is it possible to populate a ComboBox using the Columns property of a dataview? If so how? :confused:
Do you mean the column name?
Yes, Column Name
Any recommendations on this?
Sorry, missed out on this one earlier. I don't have the IDE open, but try looking for a columns collection's .Name property. If not in a dataview, it should exist in a dataset.
Thanks Mendhak, I am making progress, but still missing one piece (I think)
Here's what I HAD
'cboFieldName.Items.Add("Student ID")
'cboFieldName.Items.Add("First Name")
'cboFieldName.Items.Add("Last Name")
'cboFieldName.Items.Add("Account Balance")
'cboFieldName.Items.Add("Employee")
Here's what I want...
cboFieldName.DataSource = m_dsStudents.Tables("Students")
cboFieldName.DisplayMember = "what goes here"
'From what I read the display member is looking for text. I want to pull the column headings. Any ideas?
any ideas?
I have made some progress using:
For intIndex As Integer = 0 To m_dvStudents.Table.Columns.Count - 1
cboFieldName.Items.Add(m_dvStudents.Table.Columns(intIndex).ColumnName)
Next intIndex
But how do I use the "Value" of the Column vs the index?