Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collection as DataSource in ListBox
Message
De
04/03/2005 21:32:41
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00990658
Message ID:
00992937
Vues:
23
I too have struggled with data binding complexities.
Just to try something new, have you tried adding the new item to your collection and then rebound the listbox?

I know that winforms, for example, support either a PropertyManger or a CurrencyManager bor binding.
The PropertyManager class cannot be used to bind to complex controls like a ListBox so that isn't a likely target. The CurrencyManager supports IList and as such supports Collection objects.

Your class must support the IBindingList interface in order to sort, add and delete the items in the list.
Additionally, MS recommends "In general, do not use the use the user interface to change data programmatically. Instead, use the bound object (which is typically a DataView) to change data."
Ref: http://support.microsoft.com/default.aspx?scid=kb;EN-US;313482

So something like this may be worth a try (pardon my C#, I am a VBer):
// Get the current selection
DataRowView DrView;
yourCollectionObject IndividualDelayCollection
DrView = this.myList.SelectedItem(out yourCollection);

// Set the values programmatically
DrView["columnName"] = "Your New Information"

// Rebind the UI control
this.BindControl(this.myList);
THANKS
Joe Salvatore, Programmer/Analyst - The Stellar Group
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform