'This is the code i have, to load the combo
****************************************
SQL = "Select distinct office from tblrace"
objRetrieve = objDatabase.RetrieveDataAccess(SQL)
While objRetrieve.Read
'My class has to items.One is office and the other is "Candidate name" both
are strings.In here I am adding only office
objclsCombo.Office = objRetrieve.Item("Office")
cboRace.Items.Add(objclsCombo)
End While
*****************************************
I put this code in this event, its always giving the last item in the combo.
but the combo shows the selected item.
Private Sub cboRace_SelectedValueChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cboRace.SelectedValueChanged
MessageBox.Show(CType(cboRace.SelectedItem, clsComboRace).Office.ToString)
end sub
************************************************** ************
Siva
"Mike McIntyre" <mi****@dotnetshowandtell.com> wrote in message
news:uE****************@TK2MSFTNGP12.phx.gbl...
Good article at: http://www.mgbrown.com/PermaLink.aspx?ItemID=37
--
Mike
Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com
"Sivaprasad" <ss********@hotmail.com> wrote in message
news:Oy**************@tk2msftngp13.phx.gbl... Hi,
I have a combo box which displays FirstName+ Last Name of a person.
I want to store their id's in the combo like we store in ItemData of VB 6
combo box.
Is there any itemdata equivalent in VB.Net Combo?
Another problem is,
I am trying to do this using a class and add this class in the combo.
But SelectedIndexChanged event of combo box is returning the same last
item every time i change the selection.
Please help me on both.
Thanks
Siva