Since you have 3 items defined, index 2 should be valid. If not, probably your ComboBox hasn't been initialized yet with the array and therefore has 0 items to select (only available index would be -1 then)