Irakli Lekishvili
Irakli Lekishvili

Reputation: 34198

combobox select item

I have my combobox is filling from dgv on form load everything is ok, but i want to focus that value which i will provied.

For example:

If my combobox contains 2 , 3 , 4, 5 when form load and combo box filling is end i want to first value was 4.

How i can do that?

Upvotes: 1

Views: 3802

Answers (2)

Robert Wagner
Robert Wagner

Reputation: 17793

Using the SelectedValue property is probably better as it selected based on the value of the combo. SelectedIndex selects based on the Ordinal position instead of the actual value.

Upvotes: 0

Ben Voigt
Ben Voigt

Reputation: 283803

Set the SelectedIndex property.

Upvotes: 1

Related Questions