|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Odd Dropdownlist problemwe 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. 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. > > 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. > > > >
Custom Controls & Javascript
DataGrid with edititemtemplate What happened to Alignment property? Another basic question: How to call and show one Web Form from another Web Form? RadioButton in 2 GroupNames? ASP.net datagrid with more than 1 datasource ListBox not firing SelectedIndexChanged (AutoPostBack=True) Event Handling Question Problems with ListBox Control Dropdownlist doesnot allow child control. |
|||||||||||||||||||||||