Re: Strange ComboBox Behavior

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Eric (msdnsupport_at_nospammediserve.com)
Date: 04/23/04


Date: Fri, 23 Apr 2004 16:43:33 -0700

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?
>
>



Relevant Pages

  • Re: Strange ComboBox Behavior
    ... > Stranger yet. ... I created events for each of the comboBoxes shown below. ... >> I have two ComboBoxes on a form both set to a different datasource. ... >> retrieving the SelectedText from one the other's SelectedItem property ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Strange ComboBox Behavior
    ... I have two ComboBoxes on a form both set to a different datasource. ... retrieving the SelectedText from one the other's SelectedItem property goes ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: is reset datasource of bound combobox possible?
    ... > 2) Both comboboxes have separate arraylists as their datasource. ... > contains 3 tab pages, one of which contains the comboboxes. ... I notice combobox 2's DisplayValueChanged event fires ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: ComboBox in User Control
    ... This behavior is expected if you try to set same object as datasource ... You should Clone ... DataTable when you change a value in one of the comboBoxes, ... HTH. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: ComboBox in User Control
    ... Dim states as DataTable = getStatesList ... I'm assuming copy does the samething as the clone with the for each row ... > and then assign it as the datasource. ... > DataTable when you change a value in one of the comboBoxes, ...
    (microsoft.public.dotnet.framework.windowsforms.controls)