ComboBox SelectedIndex
.NET (Core and Framework)
2
Posts
2
Posters
0
Views
1
Watching
-
Noticed something odd with this property of the ComboBox control. If the SelectedIndex is greater than zero and I attempt to set it to -1, the value instead changes to zero. If the value is already zero, it will change to -1. Any idea why/how it behaves like this? >>>-----> MikeO
-
Noticed something odd with this property of the ComboBox control. If the SelectedIndex is greater than zero and I attempt to set it to -1, the value instead changes to zero. If the value is already zero, it will change to -1. Any idea why/how it behaves like this? >>>-----> MikeO
Is it Windows forms or Web forms? In Web forms selectedindex can never be set to -1 as the indexing starts with 0 always. If it is windows forms can you post the code snippet?