I have two ComboBoxes on a form both set to a different datasource. When
retrieving the SelectedText from one the other's SelectedItem property goes
to -1. If I remove one or the other they work fine independantly. If they
were both set to the same datasource I might understand but they are
connected to two seperate datasources. Any ideas?

Re: Strange ComboBox Behavior by Eric

Eric
Fri Apr 23 18:43:33 CDT 2004

Stranger yet.

So, I tried manually loading the ComboBoxes and that did not fix the
problem. I created events for each of the comboBoxes shown below. The
events only fire when you change values in the combobox as you would expect.
But the really strange part is that creating these events fixed the
problem!!!!

private void ddlCategory_SelectedIndexChanged(object sender,
System.EventArgs e)
{
string strTemp = "";
}

private void ddlObsUnits_SelectedIndexChanged(object sender,
System.EventArgs e)
{
string strTemp = "";
}

"Eric" <msdnsupport@nospammediserve.com> wrote in message
news:%23lJh%23EXKEHA.2692@tk2msftngp13.phx.gbl...
> I have two ComboBoxes on a form both set to a different datasource. When
> retrieving the SelectedText from one the other's SelectedItem property
goes
> to -1. If I remove one or the other they work fine independantly. If they
> were both set to the same datasource I might understand but they are
> connected to two seperate datasources. Any ideas?
>
>



Re: Strange ComboBox Behavior by Eric

Eric
Fri Apr 23 18:52:05 CDT 2004

I take it back. Apparently just a fluke. It still does not work.

"Eric" <msdnsupport@nospammediserve.com> wrote in message
news:OkkgMzYKEHA.1348@TK2MSFTNGP12.phx.gbl...
> Stranger yet.
>
> So, I tried manually loading the ComboBoxes and that did not fix the
> problem. I created events for each of the comboBoxes shown below. The
> events only fire when you change values in the combobox as you would
expect.
> But the really strange part is that creating these events fixed the
> problem!!!!
>
> private void ddlCategory_SelectedIndexChanged(object sender,
> System.EventArgs e)
> {
> string strTemp = "";
> }
>
> private void ddlObsUnits_SelectedIndexChanged(object sender,
> System.EventArgs e)
> {
> string strTemp = "";
> }
>
> "Eric" <msdnsupport@nospammediserve.com> wrote in message
> news:%23lJh%23EXKEHA.2692@tk2msftngp13.phx.gbl...
> > I have two ComboBoxes on a form both set to a different datasource. When
> > retrieving the SelectedText from one the other's SelectedItem property
> goes
> > to -1. If I remove one or the other they work fine independantly. If
they
> > were both set to the same datasource I might understand but they are
> > connected to two seperate datasources. Any ideas?
> >
> >
>
>



RE: Strange ComboBox Behavior by v-yiy

v-yiy
Mon Apr 26 00:22:11 CDT 2004

Hi Eric,

From you description, the ComboBoxes are using difference datasources, then
I'd like to know if there is any other bindings on these ComboBoxes, such
as ValueMember, SelectedItem etc.
Could you let me know more about this problem, then I could do some
research on it to give further suggestions.
Also if it's easy to make a simple project to reproduce this problem,
please feel free to send it to me by mail.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.


Re: Strange ComboBox Behavior by Eric

Eric
Mon Apr 26 15:27:49 CDT 2004

Ying-Shen,
I have tried to forward you a test project to
'v-yiy@online.microsoft.com' but it comes back undeliverable due to an
unknown server?

Eric Owens

""Ying-Shen Yu[MSFT]"" <v-yiy@online.microsoft.com> wrote in message
news:JxIh250KEHA.2364@cpmsftngxa10.phx.gbl...
> Hi Eric,
>
> From you description, the ComboBoxes are using difference datasources,
then
> I'd like to know if there is any other bindings on these ComboBoxes, such
> as ValueMember, SelectedItem etc.
> Could you let me know more about this problem, then I could do some
> research on it to give further suggestions.
> Also if it's easy to make a simple project to reproduce this problem,
> please feel free to send it to me by mail.
> Thanks!
>
> Best regards,
>
> Ying-Shen Yu [MSFT]
> Microsoft Community Support
> Get Secure! - www.microsoft.com/security
>
> This posting is provided "AS IS" with no warranties and confers no rights.
> This mail should not be replied directly, please remove the word "online"
> before sending mail.
>



Re: Strange ComboBox Behavior by v-yiy

v-yiy
Mon Apr 26 21:31:10 CDT 2004

Hi Eric,

I'm sorry for not making it clear earlier, you need remove the word
"online" and the dot after it before sending the mail to me as described in
my signature.


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.


Re: Strange ComboBox Behavior by v-yiy

v-yiy
Wed Apr 28 04:09:23 CDT 2004

Hi Eric,

The SelectedText should be empty since focus was switched off the combbox,
when you click the button. no text was selected when the event handler was
executing.
I added a timer on to the form and print out the SelectedText property of
ComboBox ddlCategory, as you can see you you put left mouse down on the
save button, the SelectedText property become empty if you set focus back
to the comboBox , the SelctedText property return to "Tester1".

Does this behavior related to your original problem?

Also, since you said the item on another ComboBox got changed when you set
the SelectedText property on one ComboBox. Maybe you can handle the
PositionChanged event on the currencymanager of that datasource, then set a
breakpoint in the event handler, then get a complete stack trace on that
point (Note you may need load corresponding symbol file to get complete
information). Of course it would be better if you could give me a sample
program to reproduce it on my side.

Please feel free to update this thread if you have any updates on it.
Thanks!


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.