A
Anil Gupte
I am trying to use a dataset to assign a display name (one column from a
table) and also associate a value (2nd column) to each item in a dropdown
combobox. I tried it this way:
DropDownProfiles.DataSource = WizoProfilesDataSet
DropDownProfiles.ValueMember =
WizoProfilesDataSet.Tables("Profiles").Columns(0).ColumnName
DropDownProfiles.DisplayMember =
WizoProfilesDataSet.Tables("Profiles").Columns(1).ColumnName
And also this way
For RowIndex As Integer = 0 To
WizoProfilesDataSet.Tables("Profiles").Rows.Count - 1
DropDownProfiles.Items.Add(WizoProfilesDataSet.Tables("Profiles").Rows(RowIndex).Item(1))
DropDownProfiles.ValueMember =
WizoProfilesDataSet.Tables("Profiles").Rows(RowIndex).Item(0)
Next
But both don't work. What I really want to do is something like:
DropDownProfiles.items.item(rowindex).ValueMember =
WizoProfilesDataSet.Tables("Profiles").Rows(RowIndex).Item(0)
but there is no such member or property.
How does one do this?
Thanx,
table) and also associate a value (2nd column) to each item in a dropdown
combobox. I tried it this way:
DropDownProfiles.DataSource = WizoProfilesDataSet
DropDownProfiles.ValueMember =
WizoProfilesDataSet.Tables("Profiles").Columns(0).ColumnName
DropDownProfiles.DisplayMember =
WizoProfilesDataSet.Tables("Profiles").Columns(1).ColumnName
And also this way
For RowIndex As Integer = 0 To
WizoProfilesDataSet.Tables("Profiles").Rows.Count - 1
DropDownProfiles.Items.Add(WizoProfilesDataSet.Tables("Profiles").Rows(RowIndex).Item(1))
DropDownProfiles.ValueMember =
WizoProfilesDataSet.Tables("Profiles").Rows(RowIndex).Item(0)
Next
But both don't work. What I really want to do is something like:
DropDownProfiles.items.item(rowindex).ValueMember =
WizoProfilesDataSet.Tables("Profiles").Rows(RowIndex).Item(0)
but there is no such member or property.
How does one do this?
Thanx,