I have a combo box that I want to loop through all of the items in it and if the string returned from a function is in the list items I want to set the text to that string. I found a way to do it but it seems like there must be a better way to do it. Here is the way I'm currently doing it. Head is the string returned from my function. Any suggestions?
Code:
For Each row As System.Data.DataRowView In cboHead.Items
If (row.Row.Item(0).ToString) = head Then
cboHeadead.Text = head
Exit For
End If
Next