Home All Groups Group Topic Archive Search About
Author
14 Jun 2005 4:20 PM
bull2000@newsgroup.nospam
we have two dropdownlist controls in a program. both of them have the same
data items in the list.
these dropdownlists are populated in Page_Load and set selected value using
SelectedValue.
the odd thing is when one is changed the other one will be changed as well.

NewBranch.SelectedValue = (string)dr["NewBranch"];
OldBranch.SelectedValue = (string)dr["OldBranch"];

It seems somehow the wire gets crossed. I checked the declaration and other
code and can not find anything wrong.
Any idea what could be wrong, where to look.

Thanks a lot for your help


PS. we have a working version of code and do not seem any difference between
the working version and the debuggy one.

Author
14 Jun 2005 7:34 PM
Harolds
The problem is you populating the dropdowns with the same data. What I mean
is, when you populate the dropdowns the data is not copied to the controls
but a pointer is set to point to the data, so both controls are pointing to
the same data. It is hard to explain. But if you don't understand what I am
saying, post you code and I will try to use it to explain better.

Show quoteHide quote
"bull2000@newsgroup.nospam" wrote:

> we have two dropdownlist controls in a program. both of them have the same
> data items in the list.
> these dropdownlists are populated in Page_Load and set selected value using
> SelectedValue.
> the odd thing is when one is changed the other one will be changed as well.
>
> NewBranch.SelectedValue = (string)dr["NewBranch"];
> OldBranch.SelectedValue = (string)dr["OldBranch"];
>
> It seems somehow the wire gets crossed. I checked the declaration and other
> code and can not find anything wrong.
> Any idea what could be wrong, where to look.
>
> Thanks a lot for your help
>
>
> PS. we have a working version of code and do not seem any difference between
> the working version and the debuggy one.
>
>
Author
14 Jun 2005 7:54 PM
bull2000@newsgroup.nospam
Harolds,
  I understand what you mean. Thanks a lot.

Show quoteHide quote
"Harolds" wrote:

> The problem is you populating the dropdowns with the same data. What I mean
> is, when you populate the dropdowns the data is not copied to the controls
> but a pointer is set to point to the data, so both controls are pointing to
> the same data. It is hard to explain. But if you don't understand what I am
> saying, post you code and I will try to use it to explain better.
>
> "bull2000@newsgroup.nospam" wrote:
>
> > we have two dropdownlist controls in a program. both of them have the same
> > data items in the list.
> > these dropdownlists are populated in Page_Load and set selected value using
> > SelectedValue.
> > the odd thing is when one is changed the other one will be changed as well.
> >
> > NewBranch.SelectedValue = (string)dr["NewBranch"];
> > OldBranch.SelectedValue = (string)dr["OldBranch"];
> >
> > It seems somehow the wire gets crossed. I checked the declaration and other
> > code and can not find anything wrong.
> > Any idea what could be wrong, where to look.
> >
> > Thanks a lot for your help
> >
> >
> > PS. we have a working version of code and do not seem any difference between
> > the working version and the debuggy one.
> >
> >