Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ComboBox.DataSource
Message
 
À
12/08/2005 10:17:19
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01040543
Message ID:
01040549
Vues:
16
Bonnie,
Yes the DataSource is set to this.oXPortCollection before the code that I posted was executed.
There were items in the collection (and in the combobox) before the code below was executed.

The reason I set it to null first was because I remembered having to do something like that in VFP.
Einar

>Just a guess, Einar ... but did you already have the DataSource set, then added a new item to the collection?
>
>~~Bonnie
>
>
>
>>I found this a little odd this morning. Considder the code below:
>>
>>
>>this.oXPortCollection.Add(oXPrt);
>>
>>// Without the line below the new item added above does not show up in the combobox
>>this.cboSboxes.DataSource = null;
>>
>>this.cboSboxes.DataSource = this.oXPortCollection;
>>
>>
>>At first I did not have the line setting the DataSource to null but without that line the combobox did not display the newly added item to the collection. I added the collection to the watch window and could see that the new item was in there. I also wrote to the console all the items in the collection.
>>
>>Why do I have to set the DataSource to null first?
>>
>>I also experimented with code where I created a new collection, added the new item then looped through the old collection and added all the items from the old collection to the new collection. Then I set the old collection to equal the new collection and set the combobox' datasource to the old collection, in that case I did not have to set the datasource to null first.
>>
>>Any thoughts.
>>
>>Thanks,
>>Einar
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform