Hmmm, very strange!
Sure it's a zero and not an Oh?
The Combo is definatly instantiated at that point?
Definatly has at least one item in it.
Don't think you'd get that error even if it wasn't
Otherwise, can't see anything wrong.
Try this code as an experiment:
int indexValue = 0;
if(cmbProductCategoryTreeDisplayName.Items.Count > 0)
cmbProductCategoryTreeDisplayName.SelectedIndex = indexValue;
else
MessageBox.Show("Wait a minute... there's nothing here to set!!");
Cheers,
Chris.
"Jayyde" <an**@hotmail.com> wrote in message
news:e5**************@TK2MSFTNGP03.phx.gbl...
Not sure why all of a sudden this line of code:
cmbProductCategoryTreeDisplayName.SelectedIndex = 0;
is producing a "Specified cast is not valid error". In the watch it has 1
item in it at index 0. This code hasn't been changed in months and it has
never had this problem before...
Thanks for any help you guys can give me!
-Jayyde