Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

ListBox, DataSources and IBindingList

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andreas Zita - 30 Oct 2004 15:54 GMT
Hi all,

I have a frustrating problem with ListBox:

I am adding a custom collection (MyColl : CollectionBase) as the DataSource
for a standard ListBox control. When selecting an item the name of it
appears (DataBound Property) in a TextBox to allow editing. The thing is
that when Im editing the name in this TextBox I continously update the
databound property
(TextBox.DataBindings["Text"].BindingManagerBase.EndCurrentEdit() so that
the text in the ListBox always should reflect the changes made in
"realtime". However, the ListBox only seem to update when it is focused
again? Why isnt the ListBox updating instantly when a property is changed?

I tried to solve this problem by letting MyColl implement the IBindingList
Interface and having each listobject telling MyColl when a property had been
updated. MyColl then fires a OnListChanged event with the ListChangedType as
ItemChanged. However, this doesnt seem to update only the changed item but
the entire ListBox? Before, as without IBindingList, when the ListBox
updated it only updated the changed item and also did it in very "silent".
When updating through OnListChanged the ListBox "flashes" and moves the
scrollposition around just as if the list would have been rebuilt entierly.
I cant have that happen every time a key is pressed and the property is
updated. I want it to be "silent" and smooth.

Is there any way of having the "silent" updating of CollectionBase but as
frequent as the OnListChanged of IBindingList???

/Andreas Zita
Andreas Zita - 30 Oct 2004 16:13 GMT
I notices another very strange behavior: When using
OnListChanged(ListChangedType.ItemChanged, N)... N apparently should be the
new size of the collection. When complying to this (using N = List.Count)
the list isnt updating at all. When having some other value it may update or
not depending on what the scrollposition is ... ? I dont get this at all ...

/Andreas Zita

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.