Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Two ComboBoxes one datasource
Message
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Application:
Desktop
Divers
Thread ID:
01418478
Message ID:
01418517
Vues:
79
>>>Hey Guys, I am having an interesting issue. I have two combos that have the same late bound datasource designed to allow the user to select a subset of the dataset. One Start combo and one stop combo. The code is way simple.
>>>
>>>
>>>            ui_FpStartComboBox.DataSource = Common.FpFolders; //Common.FpFolders is an existing DataTable
>>>            ui_FpStartComboBox.DisplayMember = "FpFolders";
>>>            ui_FpStartComboBox.ValueMember = "FpFolders";
>>>
>>>            ui_FpStopComboBox.DataSource = Common.FpFolders;
>>>            ui_FpStopComboBox.DisplayMember = "FpFolders";
>>>            ui_FpStopComboBox.ValueMember = "FpFolders";
>>>
>>>The problem is when you select a value in one combo the value of both combos changes to the selected value. This is true when using the mouse or the arrow keys. There are no events registered and I have deleted and recreated the combos with new names. Any combos on the page using the datasource display the same item.
>>
>>IIRC this is standard behaviour. You'll need different datasources for each instance. Maybe make a list from the dataset and use that for one of them?
>>
>>>My humble thanks in advance,
>
>I was afraid this was the answer. However, it seems like a real bug. I will load down the app with a copy of data that is already loaded.
>
>Thanks.

BTW, the following works as expected
ui_FpStopComboBox.DataSource = Common.FpFolders.Copy();
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform