G
Guest
Hello,
I have 6 comboboxes, that I thought I could bind to the same datasource, and
have them display different 'selectedvalue's', but apparently I can't...
My code is as follows:
dim drv as datarowview = me.listbox1.selecteditem
dim dtbDL as datatable = _dataset1.Tables(0)
dim dtvDL as new dataview(dtbDL)
dtvDL.RowFilter = "STR_ONE" = 'Matching Text'"
'Combobox 1
Me.cbo1.datasource = dtvDL
me.cbo1.ValueMember = "STR_DISPLAY_VALUE"
me.cbo1.DisplayMember = "STR_DISPLAY_VALUE"
me.cbo1.SelectedValue = drv("ITEM_1_FROM_DATABASE").ToString
'Combobox 2
Me.cbo2.datasource = dtvDL
me.cbo2.ValueMember = "STR_DISPLAY_VALUE"
me.cbo2.DisplayMember = "STR_DISPLAY_VALUE"
me.cbo2.SelectedValue = drv("ITEM_2_FROM_DATABASE").ToString
Obviously I'm not able to do this...whatever the value is in
ITEM_2_FROM_THE_DATABASE is displayed in both.
I want all 6 comboboxes to display the same drop downlist of (76) values,
but to display the corresponding value in the database for each item.
Make sense??
Do I need to declare a new dataview each time? and/or datatable??
Thanks!
amber
I have 6 comboboxes, that I thought I could bind to the same datasource, and
have them display different 'selectedvalue's', but apparently I can't...
My code is as follows:
dim drv as datarowview = me.listbox1.selecteditem
dim dtbDL as datatable = _dataset1.Tables(0)
dim dtvDL as new dataview(dtbDL)
dtvDL.RowFilter = "STR_ONE" = 'Matching Text'"
'Combobox 1
Me.cbo1.datasource = dtvDL
me.cbo1.ValueMember = "STR_DISPLAY_VALUE"
me.cbo1.DisplayMember = "STR_DISPLAY_VALUE"
me.cbo1.SelectedValue = drv("ITEM_1_FROM_DATABASE").ToString
'Combobox 2
Me.cbo2.datasource = dtvDL
me.cbo2.ValueMember = "STR_DISPLAY_VALUE"
me.cbo2.DisplayMember = "STR_DISPLAY_VALUE"
me.cbo2.SelectedValue = drv("ITEM_2_FROM_DATABASE").ToString
Obviously I'm not able to do this...whatever the value is in
ITEM_2_FROM_THE_DATABASE is displayed in both.
I want all 6 comboboxes to display the same drop downlist of (76) values,
but to display the corresponding value in the database for each item.
Make sense??
Do I need to declare a new dataview each time? and/or datatable??
Thanks!
amber