| re: Combobox fun - "Specified argument was out of the range..."
Cor,
Thanks for the response. I tried disabling the event handler, but it made
very little difference. Now instead of the form disappearing due to the
exception, the combobox refills with Class.Property. The text box of the
control displays Class.Property, but the actual dropdown list shows the
correct items. Clicking on any one of them yields the exception:
ArgumentOutOfRange
on every line past ***
m_combo.DataSource=null;
m_combo.DataSource=m_bcs;
***
m_combo.DisplayMember="ComboName";
m_combo.SelectedIndex=-1;
On break, m_bcs shows .Count=4. ToString() clearly shows "ComboName".
What's more puzzling than anything is why this works on everything except
the removal of the last element in m_bcs. Remove or add anything anywhere
else and there are NO issues. I have a suspicion it's more to do with the
databinding process than fiddling with the indices, although I did try
disabling/reenabling the event handler in the combobox, and in other items
that are influenced by the combo box... no help. Go fish?
Cheers,
M.
"Cor Ligthert" wrote:
[color=blue]
> Michael,
>
> The combobox fun is mostly when you change an index in an indexchange event.
> That fires it again in the middle. The in my opinion most simple solution
> than. Start event with removing the Event.Handler and add it again leaving
> that event..
>
> (I don't see that event)
>
> I hope this helps something?
>
> Cor
>
>
>[/color] |