HI
I have a combobox which is populated from a datatable.
I hae a list of values also and when one is selected i would like it to highlight the correct value in the combo box and have been trying to no avail.
my code is
eveytime i sellect a value in my list nothing happejns to my combo box (i.e. it goes blank and it doesnt show the sleected item like i would like!:ambivalence
I have a combobox which is populated from a datatable.
I hae a list of values also and when one is selected i would like it to highlight the correct value in the combo box and have been trying to no avail.
my code is
VB.NET:
Dim searchrow() As DataRow
Dim searchrow2() As DataRow
Dim cellvalue As String = dgvStockComps.Rows(e.RowIndex).Cells(1).Value
'find component
searchrow = dtSysComps.Select("[component] = '" & dgvStockComps.Rows(e.RowIndex).Cells(1).Value & "'")
searchrow2 = dtSysCompsParams.Select("[comp-type] = '" & searchrow(0)(14) & "'")
Me.drpCompType.SelectedItem = Me.drpCompType.Items.IndexOf(searchrow2(0)(2).ToString)
Me.drpCompType.Update()
eveytime i sellect a value in my list nothing happejns to my combo box (i.e. it goes blank and it doesnt show the sleected item like i would like!:ambivalence