Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Collection as DataSource in ListBox
Message
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00990658
Message ID:
00992937
Views:
22
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
Previous
Reply
Map
View

Click here to load this message in the networking platform