Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm filling a Combox with values from a database. After that I get the last value from another table and want to position the combobox to the correct value. The questions is how?

 

For Each BadgeItem In frmMainForm.cboBadge.Items
  If BadgeItem.Badge = myDataRow.Item("Data") Then
     'Set correct index, but how?
  End If
Next

Posted
I'm filling a Combox with values from a database. After that I get the last value from another table and want to position the combobox to the correct value. The questions is how?

 

For Each BadgeItem In frmMainForm.cboBadge.Items
  If BadgeItem.Badge = myDataRow.Item("Data") Then
     'Set correct index, but how?
  End If
Next

 

 

Try to use SelectedIndex instead of SelectedItem, if the item is the last one, you can select it by counting the items

Fat kids are harder to kidnap

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...