I honestly have no idea what's going on here, I can only find this error mentioned in a few specific places around the whole of the internet. I'm using Silverlight4. I have a combobox that is bound to an observable collection. The observable collection has two things in it. If I try and set the combobox's selectedindex to 0, it works fine, but if I try and set it to one, I get the exception:
"GeneratorPosition '-1,1' "passed to Remove does not have Offset equal to 0". Parameter name: position"
..Any thoughts at all? The only really useful reference I found to this was http://qa.social.msdn.microsoft.com/Forums/en-US/silverlightgen/thread/e6e07c42-4d64-4973-965d-c4b6dd32cfd9 and it seems to indicate that it's a problem native to Silverlight.
For those occasional googlers that come across this, I don't recall exactly how I fixed this, but it wound up being something silly like setting the combobox's ItemsSource
to null
, setting a new ObservableCollection
equal to the old one, and then assigning the new one to the combobox's ItemsSource
.
Really I think this comes down to Silverlight being kind of buggy. I'm curious why it's actually happening if someone wants to go and use the reflector, but the above should help all the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With